I have some problems in the full screen DialogFragment show. In my application, I have a fragment that, when you click on some button, calls DialogFragment. But DialogFragment just fills the area of the fragment (below the action bar). I would like it to fill the entire screen as follows: http://img845.imageshack.us/img845/8682/myimage2.png
Any help?
public class ItensActivity extends Fragment { ... public void openDialogItens() { dialog = new ItemDialog(); dialog.show(getFragmentManager(), ""); getFragmentManager().executePendingTransactions(); } public static class ItemDialog extends DialogFragment { @SuppressWarnings("deprecation") @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(getContentView()); Dialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(true); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(dialog.getWindow().getAttributes()); lp.width = WindowManager.LayoutParams.WRAP_CONTENT; lp.height = WindowManager.LayoutParams.FILL_PARENT; dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setAttributes(lp); return dialog; } private View getContentView() { LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.popup_item, null); return view; } }
source share