summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-11-10 11:29:18 -0800
committerJohn Reck <jreck@google.com>2011-11-10 11:29:18 -0800
commit93384ff95133b2ee0acae696c7ce050f28c0dd86 (patch)
tree25d790ea49c8c5c45645e3ca718224d804dea128 /src/com
parent90cb7324f228b27ac6d84ed37b39b9f887a5a316 (diff)
downloadpackages_apps_browser-93384ff95133b2ee0acae696c7ce050f28c0dd86.zip
packages_apps_browser-93384ff95133b2ee0acae696c7ce050f28c0dd86.tar.gz
packages_apps_browser-93384ff95133b2ee0acae696c7ce050f28c0dd86.tar.bz2
Handle error condition when inserting snapshots
Bug: 5599226 Change-Id: I4429ed965325d908cdc5094c37d856f4d9d68933
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/Controller.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 9710669..9402a77 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1624,12 +1624,20 @@ public class Controller
@Override
protected Long doInBackground(Tab... params) {
Uri result = cr.insert(Snapshots.CONTENT_URI, values);
+ if (result == null) {
+ return null;
+ }
long id = ContentUris.parseId(result);
return id;
}
@Override
protected void onPostExecute(Long id) {
+ if (id == null) {
+ Toast.makeText(mActivity, R.string.snapshot_failed,
+ Toast.LENGTH_SHORT).show();
+ return;
+ }
Bundle b = new Bundle();
b.putLong(BrowserSnapshotPage.EXTRA_ANIMATE_ID, id);
mUi.showComboView(ComboViews.Snapshots, b);