标签:
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; }
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_favorites" android:icon="@drawable/menu_favorites_selector" android:title="@string/fmradio_strings_menu_favorites_txt" android:orderInCategory="0" android:showAsAction="ifRoom" /> <item android:id="@+id/menu_trackid" android:icon="@drawable/trackid_button_selector" android:title="@string/fmradio_strings_menu_track_id_txt" android:orderInCategory="1" android:visible="false" android:showAsAction="ifRoom" /> <item android:id="@+id/menu_facebook_like" android:icon="@drawable/facebook_like_button_selector" android:title="@string/description_facebook_like" android:orderInCategory="2" android:visible="false" android:showAsAction="ifRoom" /> <item android:id="@+id/menu_toggle_power" android:icon="@drawable/icn_action_power" android:title="@string/description_power" android:orderInCategory="3" android:showAsAction="always" /> <item android:id="@+id/menu_rescan" android:title="@string/fmradio_strings_menu_rescan_radio_stations_ics_txt" android:orderInCategory="3" android:showAsAction="never" /> <item android:id="@+id/menu_play_in_speaker" android:title="@string/fmradio_strings_menu_play_in_speaker_ics_txt" android:orderInCategory="4" android:showAsAction="never" /> <item android:id="@+id/menu_play_in_headphones" android:title="@string/fmradio_strings_menu_play_in_headphones_ics_txt" android:orderInCategory="4" android:showAsAction="never" /> <item android:id="@+id/menu_play_in_mono" android:title="@string/fmradio_strings_menu_play_in_mono_ics_txt" android:orderInCategory="5" android:showAsAction="never" /> <item android:id="@+id/menu_play_in_stereo" android:title="@string/fmradio_strings_menu_play_in_stereo_ics_txt" android:orderInCategory="5" android:showAsAction="never" /> <item android:id="@+id/menu_select_region" android:title="@string/fmradio_strings_menu_set_radio_region_txt" android:orderInCategory="6" android:showAsAction="never" /> <item android:id="@+id/menu_visualizer" android:title="@string/fmradio_strings_menu_visualizer_txt" android:orderInCategory="7" android:showAsAction="never" /> <!-- Debug menu items below --> <item android:id="@+id/menu_debug_toggle_frequency_precision" android:title="Change nbr decimals" android:orderInCategory="8" android:showAsAction="never" android:visible="false" /> <item android:id="@+id/menu_send_feedback" android:title="@string/fmradio_strings_menu_send_feedback_txt" android:orderInCategory="9" android:showAsAction="never" android:visible="false" /> </menu>
标签:
原文地址:http://www.cnblogs.com/muhe221/p/4535921.html