0

I cant get my activity to display as full screen. In my manifest file i have added

<application android:icon="@drawable/icon" android:label="@string/app_name"
    android:debuggable="true">
        <activity android:name=".ActivityName" android:label="@string/app_name"
            android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

</activity>

Am i missing something??

jsp
  • 2,546
  • 5
  • 36
  • 63

2 Answers2

0

Check the activity you are trying to make full screen if its extending ActionBar or AppCompatActivity??? Change it to Activity instead of ActionBar or AppCompatActivity. Then try.

"public class WelcomeScreen extends Activity {
         //Code
}
"
Narendra Jadon
  • 148
  • 1
  • 11
0

It looks very similar to what works for me, except I do it on the application tag eg.

 <application android:icon="@drawable/icon" android:label="@string/app_name"
   android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

I think you can set programmaticly like this as well however I have not done this way

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

EDIT

here is a full layout of a fullscreen test app i threw together

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.xxx.fullscreen"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/icon" android:label="@string/app_name"  android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    <activity android:name=".fullscreenActivity"
              android:screenOrientation="portrait"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

ocross
  • 593
  • 1
  • 5
  • 24
  • well sounds like you have something restricting it from going full Screen in the first place, those are the recommended calls for enabling fullscreen. What SDK level are you targeting / using to test? and is this occurring on the emulator or on a real device? – ocross Jun 28 '11 at 22:28
  • i m trying it on api8. it happens both on the device n emulator – jsp Jun 28 '11 at 22:30
  • i know it may sounds silly but i have had luck fixing layout issues like this by simply moving around where i put the property. so try a few spots in the area and the . Besides that I would say create a test case with just using your layout on a blank application and see if you can get it to work. If it does work then somewhere else in your code is restricting this functionality – ocross Jun 28 '11 at 23:03
  • i think the problem might be in my linearlayout inside scrollview that i m using in my activity. there are [link]couple(http://stackoverflow.com/questions/2599837/linearlayout-not-expanding-inside-a-scrollview) of questions on those on SO...will take a look at those and post my findings..thxs – jsp Jun 28 '11 at 23:25
  • My layout included scrollview,linearlayout & tablelayout. Once i removed the linearlayout it seem to work ok. I think it was something to do with the settings on the linearlayout ...maybe it was an overkill having so many layers when all i want is to arrange my widgets in a table.. – jsp Jul 07 '11 at 16:25