Search code examples
androidandroid-actionbaractionbarsherlock

ActionBarSherlock old title bar still visivle on older android versions


I have my interface implemented with ActionBarSherlock, and it works great with the newest android versions. But this android 2.1 to android 2.3, it keeps the older title bar, I can't find a way to remove it.

I've already tried:

 if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
            if (actionBar != null) {
                this.requestWindowFeature(Window.FEATURE_NO_TITLE);
            }

        }

With the android Window object and Sherlock's Window object. Can't make thar bar go away...


Solution

  • res/values/style.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <resources xmlns:android="http://schemas.android.com/apk/res/android">
        <style name="AppTheme" parent="@android:style/Theme.Black.NoTitleBar" />
    </resources>
    

    res/values-v11/style.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <resources xmlns:android="http://schemas.android.com/apk/res/android">
        <style name="AppTheme" parent="@android:style/Theme.Holo.NoActionBar" />
    </resources>
    

    In AndroidManifest.xml:

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        ...
    </application>