7

In my application i want to create an action bar which as my application icon and a view control. I refered so many tutorials and samples to create action bar but all of them have a plenty of code. I have also read the ActionBarSherlock but this need minsdkversion 15 to compile the libraries. Because i am new in android therefore i need a step by step tutorial to create a simple action bar. If you know a simple and easy tutorial to create action bar using xml then please post your answer.

9
  • 3
    actionbarsherlock.com using this lib ....
    – kyogs
    Commented May 28, 2012 at 12:33
  • did you gone thru this: developer.android.com/guide/topics/ui/actionbar.html Commented May 28, 2012 at 12:33
  • action bar sherlock is actually working on api level BELOW android 3.0 (level 11) Commented May 28, 2012 at 12:36
  • I saw the viedeo tutorial to implement the sherlock in android app. In this tutorial first he implement the sherlock application (implement on 4.0)and then attach that application to the application which havs api level below 3.0. Commented May 28, 2012 at 12:41
  • 5
    "I have also read the ActionBarSherlock but this need minsdkversion 15 to compile the libraries." -- no, you do not. You need your build target to be API Level 14 or higher. Your android:minSdkVersion can be anything 7 or higher. Commented May 28, 2012 at 12:43

2 Answers 2

6

I've used this library for adding an action bar to 2.2+ apps:

https://github.com/johannilsson/android-actionbar

I found it easy to use and visually appealing, although the style of it does not exactly match the default action bar in ICS.

14
  • Now my application is installed in the emulator but my app icon doesn't show on my emulator home screen. I followed the example of actionbar given in github.com/johannilsson/android-actionbar and used this example in my application. But in this example there is no activity in the AndroidManifest xml file and one thing also In this example package name is com.markupartist.android.widget.actionbar so i want to know that should i put my all Activity files in that package or not. Commented May 29, 2012 at 12:55
  • and please tell me that what is the use of this line import com.markupartist.android.widget.actionbar.R; In actionbar.java Commented May 29, 2012 at 12:56
  • 1
    @NaveenChauhan I don't believe that apps appear on the home screen by default, have you checked the app launcher?
    – Ian Newson
    Commented May 29, 2012 at 14:11
  • 1
    @NaveenChauhan the import statement refers to the ActionBar library projects resources, such as drawables and XML layout files. Importing it allows the code to refer to resources easily, e.g. setContentView(R.layout.myLayout)
    – Ian Newson
    Commented May 29, 2012 at 14:14
  • 1
    Yes, it will work with Android 2.3. I think HomeActivity.apk is the one you should install.
    – Ian Newson
    Commented May 30, 2012 at 20:32
2

Read this tutorial from Android's official site. Action Bar Android You just need to include android-support-v7-appcompat.jar support jar in your project from your android-sdk-windows\extras\android\support\v7\appcompat\libs path on your disk. Then you can use ActionBar below API 11 in Android.

Official Android Tutorial is here: Action Bar Android Official Sherlock bar was creating issues for me then I got this solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.