Search code examples
androidactionbarsherlockandroid-manifest

Fullscreen Mode using ActionBarSherlock on Devices running API <11


Is there a way to go in fullscreen mode using ActionBarSherlock on Devices running API <11?

Further Information:

My app is using ActionBarSherlock and while testing on different devices i stumbled on a problem.

If i try tro launch an activity in fullscreen

android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 

on a Device running on a API lower than 11 the following error occured:

 05-29 10:12:54.436: E/AndroidRuntime(1034): FATAL EXCEPTION: main
 05-29 10:12:54.436: E/AndroidRuntime(1034): java.lang.RuntimeException: Unable to   start activity      ComponentInfo{de.osthessennews.osthessennewsapp/com.example.listview.PlayVideo}: java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light,   Theme.Sherlock.Light.DarkActionBar, or a derivative.

The error occurs, cuz the Line in the Manifest isn't supported for Devices running on API's < 11.

So i know what is causing the problem, but i dont know how to resolve it. I hope one of you guys can help me.

Manifest Snipped:

 <application
    android:allowBackup="true"  
    android:icon="@drawable/ic_launcher"       
    android:label="@string/app_name"
    android:theme="@style/Theme.Sherlock" >
    >   

Solution

  • You Can do Programmatically :

    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    Use before setContentView().