diff options
author | Leon Scroggins <scroggo@google.com> | 2010-11-15 17:49:10 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-11-15 17:49:10 -0500 |
commit | 7c08a2b624566e731b4f23235d05de6eb2859235 (patch) | |
tree | 89b96414f86e536f23d345033e1f1aa0bbb9034b /src/com/android/browser/OpenDownloadReceiver.java | |
parent | 1d88aa02955a2579e38f6aeea56ec737a0310d62 (diff) | |
download | packages_apps_Browser-7c08a2b624566e731b4f23235d05de6eb2859235.zip packages_apps_Browser-7c08a2b624566e731b4f23235d05de6eb2859235.tar.gz packages_apps_Browser-7c08a2b624566e731b4f23235d05de6eb2859235.tar.bz2 |
Go to downloads page if you cannot open the download.
Bug:3198275
Change-Id: I080618e34db68974418ad9f4580cab29da54e81f
Diffstat (limited to 'src/com/android/browser/OpenDownloadReceiver.java')
-rw-r--r-- | src/com/android/browser/OpenDownloadReceiver.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/browser/OpenDownloadReceiver.java b/src/com/android/browser/OpenDownloadReceiver.java index 02dba51..3970a5f 100644 --- a/src/com/android/browser/OpenDownloadReceiver.java +++ b/src/com/android/browser/OpenDownloadReceiver.java @@ -17,6 +17,7 @@ package com.android.browser; import android.app.DownloadManager; +import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -53,7 +54,11 @@ public class OpenDownloadReceiver extends BroadcastReceiver { Intent launchIntent = new Intent(Intent.ACTION_VIEW); launchIntent.setDataAndType(uri, context.getContentResolver().getType(uri)); launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(launchIntent); + try { + context.startActivity(launchIntent); + } catch (ActivityNotFoundException e) { + openDownloadsPage(context); + } } } |