summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-03-01 14:31:38 -0800
committerDianne Hackborn <hackbod@google.com>2011-03-01 14:45:28 -0800
commitce418e661ab52a08a2a2c3b2f10a4dd9adf33305 (patch)
tree2a79f6d41e0edab908f20e6c03edafcf7c457436 /core/java/android/app
parent6c2193a7e26c0794f45dfb60d2a0cf6ae776f390 (diff)
downloadframeworks_base-ce418e661ab52a08a2a2c3b2f10a4dd9adf33305.zip
frameworks_base-ce418e661ab52a08a2a2c3b2f10a4dd9adf33305.tar.gz
frameworks_base-ce418e661ab52a08a2a2c3b2f10a4dd9adf33305.tar.bz2
Fix issue #3495749: Crash on choosing to open the downloaded images
This is due to the window doing a relayout after its activity is stopped, at which point it may need to interact with the adapter to load data. The fix here is to tell ViewRoot about an activity being stopped and, if in this state, hold off on doing any new measurements and layouts of the hierarchy until it is no longer stopped. In this case the relayout was happening due to the cursor being deactivated, with causes the adapter to invalidate its data. Because this is now in a dialog window, this allows the window to actually be resized smaller (unlike when in a full screen activity), and boom. Change-Id: I26442b4679819b4a4e6bc56289afd3445526750b
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/Activity.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 9e72c1b..210fd5d 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -66,6 +66,7 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
+import android.view.WindowManagerImpl;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
@@ -4401,6 +4402,9 @@ public class Activity extends ContextThemeWrapper
if (mStopped) {
mStopped = false;
mCalled = false;
+ if (mToken != null && mParent == null) {
+ WindowManagerImpl.getDefault().setStoppedState(mToken, false);
+ }
mInstrumentation.callActivityOnRestart(this);
if (!mCalled) {
throw new SuperNotCalledException(
@@ -4477,6 +4481,10 @@ public class Activity extends ContextThemeWrapper
mWindow.closeAllPanels();
}
+ if (mToken != null && mParent == null) {
+ WindowManagerImpl.getDefault().setStoppedState(mToken, true);
+ }
+
mFragments.dispatchStop();
mCalled = false;