I am trying to display a dialog fragment embeded inside another fragment but whenever it shows, There is a plain white background at the top occupying the space where the action bar normally goes.
How do i display full screen of the dialog?
Here is my dialog fragment.
public class HelpDialog extends DialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog, container, false);
return view;
}
@Override
public void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
dialog.getWindow().setBackgroundDrawable(null);
setStyle(STYLE_NO_FRAME, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
}
}
}
I have simple shown the dialog like this.
HelpDialog = new HelpDialog();
HelpDialog.show(fragmentManager, null);