0

I have made a programm based on SDK 7. Now I want to add an Actionbar to it. I changed the minSDK to 11 in the Manifest. Isn't that supposed to change the design of the layouts I already have?

Problem is, that I get returned "null" by getActionbar(). I read, that I have to activate the title bar in the OnCreate of the mainactivity. But that does'nt change anything, still "null".

I can see the titlebar, but on SDK 7 it's smaller than on SDK 11. Can't really describe my problem. I just want to use Actionbar on my old written App. But the Layout still looks like in the pic below (left).! LayoutProblems

Hope someone can help me. Thanks!

Wicked161089
  • 481
  • 4
  • 18

2 Answers2

0

If you want to use ActionBar in older devices you must use actionbar support library which is provided with the sdk.

Hellboy
  • 1,052
  • 6
  • 12
0

You should also replace the old android.jar with the new one from SDK 11 to get the new GUI. If you are using eclipse for development, just check different Project buid target under Project - Properties - Android.

gile
  • 368
  • 1
  • 7
  • first of all, thanks, second: I think I already did that. In the Project Build Path I chose API 18. And under my "gen" folder in the "Google APIs [Android 4.3]" Folder is android.jar (API 18) – Wicked161089 Dec 15 '13 at 16:53
  • perhaps you can check your styles and themes, for example android:theme="@style/AppTheme" in application tag in manifest file, is it Theme.Holo or one of its descendants? This is from android documentation regarding styles for action bar http://developer.android.com/guide/topics/ui/actionbar.html#Adding – gile Dec 15 '13 at 18:17
  • THANKS! Just tried around. Removed android.jar and reload it. Also put getWindow().requestFeature(Window.FEATURE_ACTION_BAR); before setContentView(...) as descriped here: [link](http://stackoverflow.com/questions/10031180/getactionbar-returns-null) – Wicked161089 Dec 15 '13 at 20:12