Current location - Recipe Complete Network - Complete cookbook of home-style dishes - How to do csdn in the drop-down menu in the upper right corner of Android
How to do csdn in the drop-down menu in the upper right corner of Android
Create a new menu type xml under res/menu, and write the project internally. Each item is a menu item.

Override the onCreateOptionsMenu method in the activity and execute getmenuinflater. Apply the method to associate the menu file just now.

Rewrite the onOptionsItemSelected method in activity, and write the logic after menu click in the method.