1.menu 的添加
menu.add(MENU_GROUP_ADD, MENU_ADD, 0, R.string.menu_add).setIcon(
android.R.drawable.ic_menu_add).setAlphabeticShortcut('A');//Add item
menu.add(0, MENU_WALLPAPER_SETTINGS, 0, R.string.menu_wallpaper)
.setIcon(android.R.drawable.ic_menu_gallery)
.setAlphabeticShortcut('W');//wallpaper item add
menu.add(0, MENU_SEARCH, 0, R.string.menu_search).setIcon(
android.R.drawable.ic_search_category_default)
.setAlphabeticShortcut(SearchManager.MENU_KEY);//search item add
menu.add(0, MENU_NOTIFICATIONS, 0, R.string.menu_notifications)
.setIcon(com.android.internal.R.drawable.ic_menu_notifications)
.setAlphabeticShortcut('N');//notification item add
final Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS);
settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
menu.add(0, MENU_SETTINGS, 0,R.string.menu_settings).setIcon(android.R.drawable.ic_menu_preferences).setAlphabeticShortcut(
'P').
setIntent(settings)
;//setting item add