diff options
-rw-r--r-- | src/com/android/camera/MovieView.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/com/android/camera/MovieView.java b/src/com/android/camera/MovieView.java index 54d3e8e..0f4df52 100644 --- a/src/com/android/camera/MovieView.java +++ b/src/com/android/camera/MovieView.java @@ -33,6 +33,9 @@ public class MovieView extends NoSearchActivity { private MovieViewControl mControl; private boolean mFinishOnCompletion; + private boolean mResumed = false; // Whether this activity has been resumed. + private boolean mFocused = false; // Whether this window has focus. + private boolean mControlResumed = false; // Whether the MovieViewControl is resumed. @Override public void onCreate(Bundle icicle) { @@ -62,15 +65,30 @@ public class MovieView extends NoSearchActivity { @Override public void onPause() { - mControl.onPause(); super.onPause(); + mResumed = false; + if (mControlResumed) { + mControl.onPause(); + mControlResumed = false; + } + } + + @Override + public void onResume() { + super.onResume(); + mResumed = true; + if (mFocused && mResumed && !mControlResumed) { + mControl.onResume(); + mControlResumed = true; + } } @Override public void onWindowFocusChanged(boolean hasFocus) { - if (hasFocus) { - Log.v(TAG, "hasFocus"); + mFocused = hasFocus; + if (mFocused && mResumed && !mControlResumed) { mControl.onResume(); + mControlResumed = true; } } } |