0

I'm new in Android programming. I just wanna how to create a ActionBar for android 2.2 version.

Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
Kurt
  • 1
  • 5
  • possible duplicate of [What is the equivalent of ActionBar in earlier sdk versions?](http://stackoverflow.com/questions/6031774/what-is-the-equivalent-of-actionbar-in-earlier-sdk-versions) – towi Feb 27 '13 at 01:14

3 Answers3

3

You can use ActionBarSherlock. It's an open source library that emulates the exact features and design of the ActionBar.

Please see: http://actionbarsherlock.com

Google uses this as well in a number of applications.

Michell Bak
  • 13,182
  • 11
  • 64
  • 121
  • when I edit the minSdk version like the minSdk version of the project is 15 and the target is 15, is there a possibility that when I edit it .. it run on 2.2 version???? – Kurt Feb 24 '13 at 15:56
2

yes ActionBarSherlock is best option,

Please See https://github.com/JakeWharton/ActionBarSherlock

Kapil Vats
  • 5,485
  • 1
  • 27
  • 30
  • is the link a sample for android 2.2 version?? because many projects i download in ActionBarSherlock is for 4.0 version or higher – Kurt Feb 24 '13 at 15:33
  • Android 4.0 already have ActionBar, and whatever you have downlaoded that is not only for android 4.0, check the mainfest file for minSdk – Kapil Vats Feb 24 '13 at 15:38
  • ohh thank you by the way how to import the file in the site in Eclipse that you gave??? because when I importing the file no project appear... – Kurt Feb 24 '13 at 15:47
0

Use AppCompat library from com.android.support.

Google has released com.android.support to support things like this on older devices

Add the dependecy in build.gradle (it's NOT in the root directory) inside dependencies{...}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'
}

And change your theme to Theme.AppCompat or Theme.AppCompat.* (The wildcard represents more styles inside Theme.AppCompat