diff options
author | Bjorn Bringert <bringert@android.com> | 2009-09-30 12:34:30 +0100 |
---|---|---|
committer | Bjorn Bringert <bringert@android.com> | 2009-09-30 21:01:04 +0100 |
commit | d432c774d1fdd9b42009c4925e5c4e8fed3c6131 (patch) | |
tree | e84dfecb55cdea1143615808316668b092d21fdc | |
parent | 5bd1f9e8a6859673d0010eef3fd03cf452f4fa9f (diff) | |
download | ApplicationsProvider-d432c774d1fdd9b42009c4925e5c4e8fed3c6131.tar.gz |
Don't crash when trying to launch missing applicationandroid-sdk-1.6_r2android-1.6_r2donut-releasedonut
This is a cherry-pick of https://android-git.corp.google.com/g/28056
into donut-gms.
Fixes http://b/issue?id=2155988
"Clicking a shortcut for an uninstalled application in Quick Search Box crashes acore, requires reboot"
Change-Id: I4b1f19c15857b5905d98cb4da20c78dc4cfd6c2d
-rw-r--r-- | src/com/android/providers/applications/ApplicationLauncher.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/providers/applications/ApplicationLauncher.java b/src/com/android/providers/applications/ApplicationLauncher.java index 8463fb6..830597f 100644 --- a/src/com/android/providers/applications/ApplicationLauncher.java +++ b/src/com/android/providers/applications/ApplicationLauncher.java @@ -17,6 +17,7 @@ package com.android.providers.applications; import android.app.Activity; +import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Intent; import android.net.Uri; @@ -45,7 +46,11 @@ public class ApplicationLauncher extends Activity { launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); launchIntent.setComponent(componentName); - startActivity(launchIntent); + try { + startActivity(launchIntent); + } catch (ActivityNotFoundException ex) { + Log.w(TAG, "Activity not found: " + componentName); + } handled = true; } } |