Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove ActionBar in API below 11

I got few Activities that use "@android:style/Theme.Holo.Light.NoActionBar" as theme. API levels above 11 work without a problem, but when I set my minimumSdkVerison to "8" in manifest it tells me that it requires API level 13.

If I understood correct there is no ActionBar or "Theme.Holo" in API levels below 8, so there will be no ActionBar by default, but however if I leave "@android:style/Theme.Holo.Light.NoActionBar" out then in API levels above 11 my Activities will have the ActionBar. Is there any simple way to get rid of ActionBar in all the Activities? I tried using Sherlock ActionBar, but found it too complicated for my needs, as I only want to get rid of ActionBar above API 11 devices.

like image 555
Rohit Malish Avatar asked Feb 19 '23 07:02

Rohit Malish


1 Answers

When you create a new project with the Eclipse wizard, it creates the theme AppTheme for you, which inherits from AppBaseTheme. This theme is replaced depending on the API Level. So you can use android:Theme.Light.NoTitleBar as your default theme and android:Theme.Holo.Light.NoActionBar from API Level 11 upwards.

If you don't care about using Holo, just use android:Theme.Light.NoTitleBar as your theme.

like image 120
brillenheini Avatar answered Mar 05 '23 17:03

brillenheini