diff options
author | Michael Jurka <mikejurka@google.com> | 2012-05-09 11:42:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-09 11:42:47 -0700 |
commit | f1961269be954960ebe597ad39fc30246c6270fa (patch) | |
tree | bfbe8d4bf6df261547082785313a543d60da9760 | |
parent | cee343ad7f27c35b19db5cdeb87bdd984859e0fe (diff) | |
parent | 86a720e4927a997e9fd98276d2dab67244138f79 (diff) | |
download | android_packages_apps_Trebuchet-f1961269be954960ebe597ad39fc30246c6270fa.tar.gz android_packages_apps_Trebuchet-f1961269be954960ebe597ad39fc30246c6270fa.tar.bz2 android_packages_apps_Trebuchet-f1961269be954960ebe597ad39fc30246c6270fa.zip |
Merge "Fix issue where clicking voice search showed "App isn't installed"" into jb-dev
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 6025c701f..0bb119b31 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1862,7 +1862,7 @@ public final class Launcher extends Activity if (activityName != null) { intent.setPackage(activityName.getPackageName()); } - startActivitySafely(null, intent, "onClickVoiceButton"); + startActivity(null, intent, "onClickVoiceButton"); } catch (ActivityNotFoundException e) { Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK @@ -1919,7 +1919,7 @@ public final class Launcher extends Activity } } - boolean startActivitySafely(View v, Intent intent, Object tag) { + boolean startActivity(View v, Intent intent, Object tag) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { @@ -1936,9 +1936,6 @@ public final class Launcher extends Activity startActivity(intent); } return true; - } catch (ActivityNotFoundException e) { - Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); - Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e); } catch (SecurityException e) { Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); Log.e(TAG, "Launcher does not have the permission to launch " + intent + @@ -1949,6 +1946,17 @@ public final class Launcher extends Activity return false; } + boolean startActivitySafely(View v, Intent intent, Object tag) { + boolean success = false; + try { + success = startActivity(v, intent, tag); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); + Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e); + } + return success; + } + void startActivityForResultSafely(Intent intent, int requestCode) { try { startActivityForResult(intent, requestCode); |