0

i want to include a top menu button bar and implement click functionality in all activitys . Its like header file in websites. any idea how can i do that?

i leaf
  • 273
  • 7
  • 19
  • check this answer [here](http://stackoverflow.com/questions/7831044/how-do-i-create-a-header-or-footer-button-bar-for-my-android-application/7831387#7831387) – MKJParekh Feb 17 '12 at 06:29

2 Answers2

1

Do you mean something like Action Bar? It was introduced in Android 3.0, but with this support package you can use it on 2.x OS version

enter image description here

STeN
  • 6,262
  • 22
  • 80
  • 125
  • Yes I am looking for something like this. But i think action bar will be availabel from API version 11 and my minSdkVersion is 7. Can i use this support package to make my app compatible with action bar. – i leaf Feb 17 '12 at 06:31
  • Sure - If you will use the support package you can use many featrues from new Android version on older releases. For the Action bar there is extension for the above mentioned support package called "Sherlock Action Bar" - http://actionbarsherlock.com/. We are using it and it works perfectly - check the samples available on the web page. Hope it helps! – STeN Feb 17 '12 at 06:51
0

If you are using API Version less than 3.0 use compatibility library, and use MenuCompact showAsAction

http://developer.android.com/reference/android/support/v4/view/MenuCompat.html#setShowAsAction(android.view.MenuItem, int)

Rajdeep Dua
  • 11,190
  • 2
  • 32
  • 22