diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-12-08 14:49:15 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-12-08 14:52:58 -0800 |
commit | 9d0718042f7c0a50d825c621f82ce9a92071f07a (patch) | |
tree | 586c4f558bf9f11304a183f4261f6886301a4881 | |
parent | 514d7d8d95faadcc860f3a462daafe5fe0be3cf4 (diff) | |
download | frameworks_base-9d0718042f7c0a50d825c621f82ce9a92071f07a.zip frameworks_base-9d0718042f7c0a50d825c621f82ce9a92071f07a.tar.gz frameworks_base-9d0718042f7c0a50d825c621f82ce9a92071f07a.tar.bz2 |
Fix issues #3257701 and #3267312
3257701 Preference headers have duplicated "title" and "summary" if
title is not loaded from a resource
3267312 Fragment.onConfigurationChanged doesn't get called
Change-Id: I76e346ba88aa632ebb9aa413a2ce2645ebf357cd
-rw-r--r-- | core/java/android/app/Activity.java | 3 | ||||
-rw-r--r-- | core/java/android/app/FragmentManager.java | 23 | ||||
-rw-r--r-- | core/java/android/preference/PreferenceActivity.java | 2 |
3 files changed, 27 insertions, 1 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index d679ef6..aaebbd0 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1403,6 +1403,8 @@ public class Activity extends ContextThemeWrapper public void onConfigurationChanged(Configuration newConfig) { mCalled = true; + mFragments.dispatchConfigurationChanged(newConfig); + if (mWindow != null) { // Pass the configuration changed event to the window mWindow.onConfigurationChanged(newConfig); @@ -1566,6 +1568,7 @@ public class Activity extends ContextThemeWrapper public void onLowMemory() { mCalled = true; + mFragments.dispatchLowMemory(); } /** diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index fbad2fe..1b2d4df 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -19,6 +19,7 @@ package android.app; import android.animation.Animator; import android.animation.AnimatorInflater; import android.animation.AnimatorListenerAdapter; +import android.content.res.Configuration; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Handler; @@ -1415,6 +1416,28 @@ final class FragmentManagerImpl extends FragmentManager { mActivity = null; } + public void dispatchConfigurationChanged(Configuration newConfig) { + if (mActive != null) { + for (int i=0; i<mAdded.size(); i++) { + Fragment f = mAdded.get(i); + if (f != null) { + f.onConfigurationChanged(newConfig); + } + } + } + } + + public void dispatchLowMemory() { + if (mActive != null) { + for (int i=0; i<mAdded.size(); i++) { + Fragment f = mAdded.get(i); + if (f != null) { + f.onLowMemory(); + } + } + } + } + public boolean dispatchCreateOptionsMenu(Menu menu, MenuInflater inflater) { boolean show = false; ArrayList<Fragment> newMenus = null; diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index 7492c96..41f0d10 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -394,7 +394,7 @@ public abstract class PreferenceActivity extends ListActivity implements if (summaryRes != 0) { return res.getText(summaryRes); } - return title; + return summary; } /** |