is there any alternative for ActionBar in 2.2?

Venkat picture Venkat · Mar 20, 2012 · Viewed 8.4k times · Source

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.

Answer

Xavi Rigau picture Xavi Rigau · Mar 20, 2012

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