Adding menu item to Launcher to manage applications directly from homescreen

Change-Id: I56d726080968777eb5ccdc8826a872977cf7868c
This commit is contained in:
Winson Chung
2010-09-27 11:33:03 -07:00
parent 4a79a04bcd
commit 7ad0141905
2 changed files with 14 additions and 1 deletions

View File

@@ -101,6 +101,8 @@
<skip />
<!-- Verb, menu item used to add an item on the desktop -->
<string name="menu_add">Add</string>
<!-- Menu item used to manage installed applications -->
<string name="menu_manage_apps">Manage Apps</string>
<!-- Noun, menu item used to set the desktop's wallpaper -->
<string name="menu_wallpaper">Wallpaper</string>
<!-- Verb, menu item used to initiate global search -->

View File

@@ -105,7 +105,8 @@ public final class Launcher extends Activity
private static final int MENU_GROUP_WALLPAPER = MENU_GROUP_ADD + 1;
private static final int MENU_ADD = Menu.FIRST + 1;
private static final int MENU_WALLPAPER_SETTINGS = MENU_ADD + 1;
private static final int MENU_MANAGE_APPS = MENU_ADD + 1;
private static final int MENU_WALLPAPER_SETTINGS = MENU_MANAGE_APPS + 1;
private static final int MENU_SEARCH = MENU_WALLPAPER_SETTINGS + 1;
private static final int MENU_NOTIFICATIONS = MENU_SEARCH + 1;
private static final int MENU_SETTINGS = MENU_NOTIFICATIONS + 1;
@@ -1109,6 +1110,9 @@ public final class Launcher extends Activity
menu.add(MENU_GROUP_ADD, MENU_ADD, 0, R.string.menu_add)
.setIcon(android.R.drawable.ic_menu_add)
.setAlphabeticShortcut('A');
menu.add(0, MENU_MANAGE_APPS, 0, R.string.menu_manage_apps)
.setIcon(android.R.drawable.ic_menu_manage)
.setAlphabeticShortcut('M');
menu.add(MENU_GROUP_WALLPAPER, MENU_WALLPAPER_SETTINGS, 0, R.string.menu_wallpaper)
.setIcon(android.R.drawable.ic_menu_gallery)
.setAlphabeticShortcut('W');
@@ -1160,6 +1164,9 @@ public final class Launcher extends Activity
case MENU_ADD:
addItems();
return true;
case MENU_MANAGE_APPS:
manageApps();
return true;
case MENU_WALLPAPER_SETTINGS:
startWallpaper();
return true;
@@ -1194,6 +1201,10 @@ public final class Launcher extends Activity
showAddDialog(mMenuAddInfo);
}
private void manageApps() {
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS));
}
void addAppWidget(Intent data) {
// TODO: catch bad widget exception when sent
int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);