summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ViewImage.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2009-06-24 17:51:08 -0700
committerOwen Lin <owenlin@google.com>2009-06-25 00:07:55 -0700
commit90bbbcbdfa4f2329dfdfda867a4bd58fa27a2840 (patch)
tree202361fd4d18f7425e71c7412f8d25df91efc572 /src/com/android/camera/ViewImage.java
parent7035b131cd0a8869f7980841988258a70ca76770 (diff)
downloadLegacyCamera-90bbbcbdfa4f2329dfdfda867a4bd58fa27a2840.zip
LegacyCamera-90bbbcbdfa4f2329dfdfda867a4bd58fa27a2840.tar.gz
LegacyCamera-90bbbcbdfa4f2329dfdfda867a4bd58fa27a2840.tar.bz2
It seems that there is no quarantee that "onActivityResult()" will be called
before "onStart()". So, adding code to handle both situations. Also add checking on "mPaused" in showOnScreenControls().
Diffstat (limited to 'src/com/android/camera/ViewImage.java')
-rw-r--r--src/com/android/camera/ViewImage.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java
index af17ca8..68c129c 100644
--- a/src/com/android/camera/ViewImage.java
+++ b/src/com/android/camera/ViewImage.java
@@ -176,6 +176,7 @@ public class ViewImage extends Activity implements View.OnClickListener {
}
private void showOnScreenControls(final boolean autoDismiss) {
+ if (mPaused) return;
// If the view has not been attached to the window yet, the
// zoomButtonControls will not able to show up. So delay it until the
// view has attached to window.
@@ -1109,6 +1110,14 @@ public class ViewImage extends Activity implements View.OnClickListener {
// The CropImage activity passes back the Uri of the
// cropped image as the Action rather than the Data.
mSavedUri = Uri.parse(data.getAction());
+
+ // if onStart() runs before, then set the returned
+ // image as currentImage.
+ if (mAllImages != null) {
+ Image image = mAllImages.getImageForUri(mSavedUri);
+ mCurrentPosition = mAllImages.getImageIndex(image);
+ setImage(mCurrentPosition);
+ }
}
break;
}