Search code examples
androidandroid-actionbartitlebar

Android 4.2 Title Bar over Action Bar


In my aplication only on 4.2 devices do that:

enter image description here

My activity manifest:

<activity
   android:name=".CatalogListActivity"
   android:label="@string/lbl_catalog"
   android:theme="@style/Theme.AppCompat" >
</activity>

My onCreate:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.cataloglist_activity);

    getSupportActionBar().setBackgroundDrawable(null);

    initControls();

    checkCatalogs();

}

Solution

  • I found the bug

    the previous activity (which was a splash screen), the theme was set as fullscreen. For some reason, when I called the other activity by intent, the bug described happened.

    What I did:

    I changed the manifest to:

    android:theme="@style/Theme.AppCompat"
    

    and added in onCreate of the SplashScreen:

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

    Thanks!