diff options
author | Joe Onorato <joeo@android.com> | 2010-02-19 14:59:39 -0800 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-02-19 15:00:12 -0800 |
commit | deb98afe40cd1b6f1c042492e56b48b29320a134 (patch) | |
tree | 698c1a135808dddb3fae1c0e2b7b318c52f705d9 | |
parent | 0a6a9318edf609b11da3e8e0299269505e7743d9 (diff) | |
download | android_packages_apps_Trebuchet-deb98afe40cd1b6f1c042492e56b48b29320a134.tar.gz android_packages_apps_Trebuchet-deb98afe40cd1b6f1c042492e56b48b29320a134.tar.bz2 android_packages_apps_Trebuchet-deb98afe40cd1b6f1c042492e56b48b29320a134.zip |
minor refactor: This function is only called from one place. It doesn't need the parameters.
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index ee92fc725..7f9b0d7e6 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -369,7 +369,7 @@ public final class Launcher extends Activity completeAddApplication(this, data, mAddItemCellInfo); break; case REQUEST_PICK_SHORTCUT: - processShortcut(data, REQUEST_PICK_APPLICATION, REQUEST_CREATE_SHORTCUT); + processShortcut(data); break; case REQUEST_CREATE_SHORTCUT: completeAddShortcut(data, mAddItemCellInfo); @@ -1008,7 +1008,7 @@ public final class Launcher extends Activity } } - void processShortcut(Intent intent, int requestCodeApplication, int requestCodeShortcut) { + void processShortcut(Intent intent) { // Handle case where user selected "Applications" String applicationName = getResources().getString(R.string.group_applications); String shortcutName = intent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME); @@ -1019,9 +1019,9 @@ public final class Launcher extends Activity Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY); pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent); - startActivityForResult(pickIntent, requestCodeApplication); + startActivityForResult(pickIntent, REQUEST_PICK_APPLICATION); } else { - startActivityForResult(intent, requestCodeShortcut); + startActivityForResult(intent, REQUEST_CREATE_SHORTCUT); } } @@ -1579,7 +1579,7 @@ public final class Launcher extends Activity showDialog(DIALOG_CREATE_SHORTCUT); } - private void pickShortcut(int requestCode, int title) { + private void pickShortcut() { Bundle bundle = new Bundle(); ArrayList<String> shortcutNames = new ArrayList<String>(); @@ -1593,10 +1593,10 @@ public final class Launcher extends Activity Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY); pickIntent.putExtra(Intent.EXTRA_INTENT, new Intent(Intent.ACTION_CREATE_SHORTCUT)); - pickIntent.putExtra(Intent.EXTRA_TITLE, getText(title)); + pickIntent.putExtra(Intent.EXTRA_TITLE, getText(R.string.title_select_shortcut)); pickIntent.putExtras(bundle); - startActivityForResult(pickIntent, requestCode); + startActivityForResult(pickIntent, REQUEST_PICK_SHORTCUT); } private class RenameFolder { @@ -1801,7 +1801,7 @@ public final class Launcher extends Activity switch (which) { case AddAdapter.ITEM_SHORTCUT: { // Insert extra item to handle picking application - pickShortcut(REQUEST_PICK_SHORTCUT, R.string.title_select_shortcut); + pickShortcut(); break; } |