i'm trying to inflate a custom layout in an alertdialog. I get it, but width is expanded to fill_parent. I have tried in xml file to put wrap_content or custom size (example 200dp) and it's ever fill_parent.
I want to put my own height and width, like (200dp, 150dp), how can i put this?
I have read and tried some solutions in this web, but i can't solve my problem, can anyone help me? thanks in advance for it.
I give my java code here
`>View ff = getLayoutInflater().inflate(R.layout.customlayout, null);
>>Button menu = (Button)ff.findViewById(R.id.menu);
>>
menu.setOnClickListener(new View.OnClickListener() {
>>
public void onClick(View v) {
>// TODO Auto-generated method stub
>>gotomenu();
}
});
>
AlertDialog dialog = new AlertDialog.Builder(this)
>.setView(ff)
> .create();
> dialog.show();`
You can create LinearLayout and than add Space or just View to adjust height what you need
if you want to make height and width on your own way than make custom class extend dialog like below
and call
when you need
otherwise you can define Activity and put code in manifest like below: