I have an Android app that should show a fullscreen dialog. I've try different solution, but no one seems work. This is my code. Layout of dialog:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_transparent" >
<!--declaration of other widgets -->
</RelativeLayout>
this is Class that extends dialog:
publicMyDialog(Context context) {
super(context, R.style.DialogTheme);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.setContentView(R.layout.my_dialog);
this.setCancelable(true);
this.setCanceledOnTouchOutside(false);
this.getWindow().clearFlags(LayoutParams.FLAG_DIM_BEHIND);
}
and this is R.style.DialogTheme declaration
<style name="DialogTheme" parent="android:Theme.Dialog">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsFloating">true</item>
</style>
Now when dialog is showed it doesn't fill all screen. How can i do for make dialog occupy all screen?