summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-09-18 13:39:56 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-18 13:39:56 -0700
commit6bc9bc1aed3d5ad716d4e5e343782f9c5a5b5b59 (patch)
tree82e748261aa31b19fba5ee6b1dfa392bf8d21b83 /ui
parent1fbc4d945f27625ac8a7e03a130f8111fa1338dc (diff)
parenta6f1a024815893e952b53c072d596260713733bd (diff)
downloadandroid_packages_providers_DownloadProvider-6bc9bc1aed3d5ad716d4e5e343782f9c5a5b5b59.tar.gz
android_packages_providers_DownloadProvider-6bc9bc1aed3d5ad716d4e5e343782f9c5a5b5b59.tar.bz2
android_packages_providers_DownloadProvider-6bc9bc1aed3d5ad716d4e5e343782f9c5a5b5b59.zip
am a6f1a024: am 8ec87ea5: Unified handling of errors around opening.
* commit 'a6f1a024815893e952b53c072d596260713733bd': Unified handling of errors around opening.
Diffstat (limited to 'ui')
-rw-r--r--ui/src/com/android/providers/downloads/ui/DownloadList.java8
-rw-r--r--ui/src/com/android/providers/downloads/ui/TrampolineActivity.java6
2 files changed, 6 insertions, 8 deletions
diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java
index 991d70b6..107940c0 100644
--- a/ui/src/com/android/providers/downloads/ui/DownloadList.java
+++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java
@@ -19,7 +19,6 @@ package com.android.providers.downloads.ui;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DownloadManager;
-import android.content.ActivityNotFoundException;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
@@ -530,11 +529,8 @@ public class DownloadList extends Activity {
}
final long id = cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
- final Intent intent = OpenHelper.buildViewIntent(this, id);
- try {
- startActivity(intent);
- } catch (ActivityNotFoundException ex) {
- Toast.makeText(this, R.string.download_no_application_title, Toast.LENGTH_LONG).show();
+ if (!OpenHelper.startViewIntent(this, id, 0)) {
+ Toast.makeText(this, R.string.download_no_application_title, Toast.LENGTH_SHORT).show();
}
}
diff --git a/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java b/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java
index e9cc17ef..f96c04ee 100644
--- a/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java
+++ b/ui/src/com/android/providers/downloads/ui/TrampolineActivity.java
@@ -92,8 +92,10 @@ public class TrampolineActivity extends Activity {
break;
case DownloadManager.STATUS_SUCCESSFUL:
- final Intent intent = OpenHelper.buildViewIntent(this, id);
- startActivity(intent);
+ if (!OpenHelper.startViewIntent(this, id, 0)) {
+ Toast.makeText(this, R.string.download_no_application_title, Toast.LENGTH_SHORT)
+ .show();
+ }
finish();
break;