Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: how to show icon in ActionBar but not in the Options Menu?

How can I show an icon in an ActionBar but not in the Options Menu at the same time? Is it possible via XML only?

like image 740
Alexander Kulyakhtin Avatar asked Nov 14 '22 05:11

Alexander Kulyakhtin


1 Answers

Usually, when you have the action bar available, you don't have an action menu anymore. The menu items are not doubled.

If you get the action bar on Android SDK > 10 and the options menu on Android SDK <= 10, then consider using ActionBarSherlock, to make the action bar backwards compatible for older Android versions too:

http://actionbarsherlock.com/

like image 141
Stefan Anca Avatar answered Nov 16 '22 03:11

Stefan Anca