diff options
author | John Reck <jreck@google.com> | 2011-11-10 15:44:37 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-10 15:44:37 -0800 |
commit | 897b8838bb59fa89226a4b72e27571eefe43ca60 (patch) | |
tree | 2c9e6b7addf83855396c4a143fe9619380e6c985 | |
parent | 4409358ac603ec61f42a1b40f90d8b2893d9ad0b (diff) | |
parent | 93384ff95133b2ee0acae696c7ce050f28c0dd86 (diff) | |
download | packages_apps_browser-897b8838bb59fa89226a4b72e27571eefe43ca60.zip packages_apps_browser-897b8838bb59fa89226a4b72e27571eefe43ca60.tar.gz packages_apps_browser-897b8838bb59fa89226a4b72e27571eefe43ca60.tar.bz2 |
Merge "Handle error condition when inserting snapshots" into ics-mr1
-rw-r--r-- | src/com/android/browser/Controller.java | 8 |
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); |