summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-01-04 11:34:18 -0800
committerDianne Hackborn <hackbod@google.com>2011-01-04 11:34:18 -0800
commit352cc98b4621b76959af8f8a698fd75c6d6132e8 (patch)
treef65d9a21a6b8949eaf37280b6a0d9794b675cb88 /core/java/android/app
parent003f338b6f12400429c5d8f0fc06a477a7ce1f80 (diff)
downloadframeworks_base-352cc98b4621b76959af8f8a698fd75c6d6132e8.zip
frameworks_base-352cc98b4621b76959af8f8a698fd75c6d6132e8.tar.gz
frameworks_base-352cc98b4621b76959af8f8a698fd75c6d6132e8.tar.bz2
Few little fragment, wm tweaks.
Deal with fragments being restored when their containing view is gone. Try to put in a black background during rotation. Currently commented out because it appears to cause surface flinger to hang. Change-Id: I150d061e64488356d17513f4e2d124d7c3d04f6b
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/Fragment.java4
-rw-r--r--core/java/android/app/FragmentManager.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index a920814..3141423 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -98,6 +98,7 @@ final class FragmentState implements Parcelable {
}
mInstance.setIndex(mIndex);
mInstance.mFromLayout = mFromLayout;
+ mInstance.mRestored = true;
mInstance.mFragmentId = mFragmentId;
mInstance.mContainerId = mContainerId;
mInstance.mTag = mTag;
@@ -363,6 +364,9 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener
// Set to true when the view has actually been inflated in its layout.
boolean mInLayout;
+ // True if this fragment has been restored from previously saved state.
+ boolean mRestored;
+
// Number of active back stack entries this fragment is in.
int mBackStackNesting;
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index 3c98d67..2609c46 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -690,7 +690,7 @@ final class FragmentManagerImpl extends FragmentManager {
ViewGroup container = null;
if (f.mContainerId != 0) {
container = (ViewGroup)mActivity.findViewById(f.mContainerId);
- if (container == null) {
+ if (container == null && !f.mRestored) {
throw new IllegalArgumentException("No view found for id 0x"
+ Integer.toHexString(f.mContainerId)
+ " for fragment " + f);