How to make the app fullscreen on the Galaxy Tab

I'm trying everything I can think of to make my application display full screen on the Galaxy tab.

Basically, it works like the Lunar Lander app that comes with the Android SDK. What would you do to make the Lunar Lander app display in full screen on large screen devices such as the Galaxy Tab?

At the moment, I'm not interested in the quality of the graphics, but only how an application like this can fill the screen. It was mainly designed to work on a 320x480 MDPI screen with images in a drawable folder, and it uses SurfaceHolder and allows you to draw individual bitmap images.

Any tips?

STATEMENT: Sorry, I do not mean the full-screen mode, as when deleting the notification and title, I mean that everything around is a giant black frame, and the graphics do not occupy the entire screen.

+8
android
source share
8 answers

If you set the sdk target level to anything less than 9, then supporting too large screens is considered false. If you set targetSdkVersion = 9 in the manifest, then xlarge support is considered true. See the documentation for Multi-Screen Support , in particular for a description of compatibility mode.

+10
source share

Another way to do this is to create an xml called styles.xml in res / values

define style:

<style name="Theme.FullScreen" parent="android:Theme"> <item name="android:windowFullscreen">true</item> <item name="android:windowNoTitle">true</item> </style> 

later in the manifest tell android what activity should be in full screen mode by setting the style above:

 <activity android:name=".activity.NewSearchBrowserActivity" android:theme="@style/Theme.FullScreen" android:screenOrientation="landscape"></activity> 

in this way you are making a reusable theme that can be applied to any activity.

+6
source share

Ted mentioned XLargeSceens, the Galaxy Tab runs 2.2 and therefore does not have the xlargeScreens attribute since it was added in 2.3; Since the upcoming generation of tablets will have 3.0 and XlargeScreens, which you will want to use anyway (and compile with 2.3 / 3.0)

In the manifest, you need to declare support for all reasonable screen sizes and provide the right set of resources

 <supports-screens android:smallScreens="false" android:largeScreens="true" android:xlargeScreens="true" android:normalScreens="true" android:anyDensity="true" /> 
+5
source share

If you do not support SDK versions that are at least 4, that is:
<uses-sdk android:minSdkVersion="4"/> ,

You will need to do the following:

 <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" /> 
+2
source share
  public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); super.onCreate(savedInstanceState); setContentView(R.layout.main); 

This works great for me ... try this

+1
source share

<uses-sdk android:minSdkVersion="4" />

or your manifest is missing a different version number

0
source share

you can add this exactly under

  super.onCreate(savedInstanceState); 

for what you want to be fullscreen.

  requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 
0
source share

Give this in the manifest file:

 <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" /> 

Of course it will work.

0
source share

All Articles