Mainactivity.java Start Loading Menu
@Overridepublic boolean Oncreateoptionsmenu (Menu menu) {//Inflate the menu; This adds items to the action bar if it is PR Esent.getmenuinflater (). Inflate (R.menu.main, menu); return true;}
Configure the menu under Res under menu Main.xml
<item android:id= "@+id/lidl" android:orderincategory= "android:title=" @string/action_ Settings "/> <item android:id=" @+id/end "android:orderincategory=" "android:title=" @ String/end "/>
Android:orderincatagory Menu Sorting
Android:id Index PRIMARY key
Android:title Menu Name
Menu Response Events
public boolean onoptionsitemselected (MenuItem item) {switch (Item.getitemid ()) {case R.id.lidl:toast.maketext (this, " T1 ", Toast.length_short). Show (); Break;case R.id.end:toast.maketext (This," T2 ", Toast.length_short). Show (); return super.onoptionsitemselected (item);}
Through the brothers Lianyun Classroom, know the menu settings of the process, and 2.3 before the menu can customize the icon, 2.3 after the cancellation of the function
At this stage, a lot of calls to the method feel a bit masked
Android Getting Started learning notes-dish single