Since the ActionBar
is available only in Android 3.0 and later, what is a good way to implement ActionBar-like widget in earlier sdk versions? I am looking to do this programmatically without using the main.xml , if that helps.
-
this is a duplicate of http://stackoverflow.com/questions/6031774/what-is-the-equivalent-of-actionbar-in-earlier-sdk-versions – andr Dec 17 '12 at 21:17
3 Answers
As @Tony says you can take a look at ActionBarSherlock, a library that provides all ActionBar functionality plus extras (like new Animations and PagerIndicator) back to Android 2.x.
What it basically does is it has an implementation of ActionBar that will be used if you are running your app in a device with Android 2.x. In case that your app is running on a device with Android 3.0 or newer, it will use default Android ActionBar implementation.
I did a post last week showing how to use ActionBarSerlock in your app. If you want, you can take a look at it: Using an ActionBar in your Android app with ActionBarSherlock

- 1,421
- 13
- 17
-
com_actionbarsherlock] AndroidManifest.xml file missing! what can i do? – Venkat Mar 21 '12 at 03:31
-
Did you follow **all** the steps described on the tutorial? When does it show that error, during the importing project process or when it's already imported? – Xavi Rigau Mar 23 '12 at 10:18
You can use ActionBarSherlock (http://actionbarsherlock.com). This will let you have an Action Bar in earlier versions of Android.

- 2,335
- 21
- 25
Look at the examples app in your samples folder. There is one called actionbarcompat with actionbarcombatability.

- 27,966
- 19
- 103
- 155