Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there any alternative for ActionBar in 2.2?

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.

like image 366
Venkat Avatar asked Mar 20 '12 07:03

Venkat


2 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

like image 133
Xavi Rigau Avatar answered Oct 13 '22 00:10

Xavi Rigau


You can use ActionBarSherlock (http://actionbarsherlock.com). This will let you have an Action Bar in earlier versions of Android.

like image 22
Tony Avatar answered Oct 13 '22 01:10

Tony