I'm trying to use ActionBarCompat on my own project. I've already opened the sample project (http://developer.android.com/resources/samples/ActionBarCompat/index.html), But I don't know how to implement it on my own.
I can't find any tutorial of some kind. Should I make this project as a library? Can someone give me some directions, please.
As for implementation, just stick to the sample code provided under the MainActivity.java
class. You can find it here or under <your local android-sdks folder>/samples/android-15/ActionBarCompat/src/com/example/android/actionbarcompat/MainActivity.java
. In general, all you need to do is the following:
ActionBarActivity
onCreateOptionsMenu()
so that it inflates the menu you coded in step #1onOptionsItemSelected()
so that you handle the event when the user taps any of the ActionBar items you defined in step #1.I think it makes sense to build an Android Library project out of the ActionBarCompat code; then you can just reference it from your custom Android project. Remember it's licensed under the Apache License, Version 2.0.