diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
commit | d24b8183b93e781080b2c16c487e60d51c12da31 (patch) | |
tree | fbb89154858984eb8e41556da7e9433040d55cd4 /core/java/android/preference | |
parent | f1e484acb594a726fb57ad0ae4cfe902c7f35858 (diff) | |
download | frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.zip frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.gz frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.bz2 |
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'core/java/android/preference')
-rw-r--r-- | core/java/android/preference/PreferenceActivity.java | 7 | ||||
-rw-r--r-- | core/java/android/preference/PreferenceGroup.java | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index 95970ea..837ce91 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -103,8 +103,6 @@ public abstract class PreferenceActivity extends ListActivity implements protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - requestWindowFeature(Window.FEATURE_NO_TITLE); - setContentView(com.android.internal.R.layout.preference_list_content); mPreferenceManager = onCreatePreferenceManager(); @@ -214,6 +212,11 @@ public abstract class PreferenceActivity extends ListActivity implements public void setPreferenceScreen(PreferenceScreen preferenceScreen) { if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) { postBindPreferences(); + CharSequence title = getPreferenceScreen().getTitle(); + // Set the title of the activity + if (title != null) { + setTitle(title); + } } } diff --git a/core/java/android/preference/PreferenceGroup.java b/core/java/android/preference/PreferenceGroup.java index 4258b41..d008fd6 100644 --- a/core/java/android/preference/PreferenceGroup.java +++ b/core/java/android/preference/PreferenceGroup.java @@ -25,6 +25,7 @@ import android.content.Context; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Parcelable; +import android.text.TextUtils; import android.util.AttributeSet; /** @@ -223,6 +224,9 @@ public abstract class PreferenceGroup extends Preference implements GenericInfla * @return The {@link Preference} with the key, or null. */ public Preference findPreference(CharSequence key) { + if (TextUtils.equals(getKey(), key)) { + return this; + } final int preferenceCount = getPreferenceCount(); for (int i = 0; i < preferenceCount; i++) { final Preference preference = getPreference(i); |