summaryrefslogtreecommitdiffstats
path: root/photoviewer
diff options
context:
space:
mode:
authorMarc Blank <mblank@google.com>2012-08-21 08:59:31 -0700
committerMarc Blank <mblank@google.com>2012-08-21 08:59:31 -0700
commit3b32152852917f08eb2f196db6454c083f7acd15 (patch)
treefebdaf4fc359bbd8d34269f6c3e3b1d7dfa8a131 /photoviewer
parent46e3466c6912d54a55bde7ee0e227c495a4fe639 (diff)
downloadandroid_frameworks_ex-3b32152852917f08eb2f196db6454c083f7acd15.tar.gz
android_frameworks_ex-3b32152852917f08eb2f196db6454c083f7acd15.tar.bz2
android_frameworks_ex-3b32152852917f08eb2f196db6454c083f7acd15.zip
Abort posted runnable if cursor is no longer open
Bug: 7002552 Change-Id: I38ce1231b0ec88ebf02d4d0edb5495b8baac65d5
Diffstat (limited to 'photoviewer')
-rw-r--r--photoviewer/src/com/android/ex/photo/PhotoViewActivity.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java b/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
index 927b0e4..2e54569 100644
--- a/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
+++ b/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
@@ -303,6 +303,10 @@ public class PhotoViewActivity extends Activity implements
new Handler().post(new Runnable() {
@Override
public void run() {
+ // If the cursor is closed, we can leave, as another runnable will have
+ // been posted (this means our Cursor is already out-of-date)
+ if (data.isClosed()) return;
+
// We're paused; don't do anything now, we'll get re-invoked
// when the activity becomes active again
if (mIsPaused) {