Home » Android » android – is there any alternative for ActionBar in 2.2?

android – is there any alternative for ActionBar in 2.2?

Posted by: admin June 15, 2020 Leave a comment

Questions:

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.

How to&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

Answer:

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

Answer:

Look at the examples app in your samples folder. There is one called actionbarcompat with actionbarcombatability.