Toast Menu and use on the move

Toast use activities created

Add the following code process onCreate

 

 Click the button results in Figure

 

 Use Menu on the move

First create a directory in res Menu folder, then create a file called in the main menu file folders China

Then add the following code in the main.xml

 

 Then rewritten in FirstActivity onCreateOptionsMenu () method

 

 Then override onOptionsItemSelect () method of FirstActivity

 

 Rerun the program, the title bar on the right side signed a three, this is the menu button

 

 

 

 

Guess you like

Origin www.cnblogs.com/ccffhh/p/11939366.html