Issue
How do I create a full screen mode in XML irregardless of how small what contents are in it?
Here's my "show.xml" code:
<LinearLayout android:orientation="vertical"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_gravity="center">
<Button android:id="@+id/ok_btn" android:layout_height="fill_parent"
android:layout_width="fill_parent" android:typeface="sans" android:text="ok"></Button>
</LinearLayout>
I want to display it like another full screen page, with black background, like a main.xml. In this case, its like a pop-up screen. Removing or changing the android:layout_width and android:layout_heigh don't work. help please! :(
Solution
Afaik you can't do fullscreen in xml. You have two choices:
AndroidManifest.xml
in activity's section
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- in
onCreate()
before callingsetContentView
requestWindowFeature( Window.FEATURE_NO_TITLE );
getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN );
Answered By - Martin Nuc