January 23, 2012

ActionBar support

With Ice Cream Sandwich being on the rise now there is really no excuse for not supporting the ActionBar UI pattern anymore, even if you don't support a tablet version of your app. There are quite a few projects out there to help you with that.

Basic support is easily added thanks to the ActionBarCompat sample project that comes with the SDK. You can just copy that over into your project and have a consistent action bar (although very limited) across all Android versions.
It is also a nice example of how to abstract out platform-specific code. And consisting only of a couple of classes it is easy to understand and tweak. There is one little thing you should be aware of, though. The Home button is disabled in Ice Cream Sandwich by default, as described in this stackoverflow question).

For more complete action bar support have a look at ActionBarSherlock.

No comments:

About Me

codes for a living and also in his freetime, probably for lack of a real hobby. ;-)