Fix settings title
Change-Id: I203c577693700ef60197800632e8c33bc552ef5f
This commit is contained in:
@@ -48,10 +48,6 @@ public abstract class ToggleFeaturePreferenceFragment
|
|||||||
protected CharSequence mSettingsTitle;
|
protected CharSequence mSettingsTitle;
|
||||||
protected Intent mSettingsIntent;
|
protected Intent mSettingsIntent;
|
||||||
|
|
||||||
// TODO: Showing sub-sub fragment does not handle the activity title
|
|
||||||
// so we do it but this is wrong. Do a real fix when there is time.
|
|
||||||
private CharSequence mOldActivityTitle;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -97,9 +93,6 @@ public abstract class ToggleFeaturePreferenceFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
getActivity().getActionBar().setCustomView(null);
|
getActivity().getActionBar().setCustomView(null);
|
||||||
if (mOldActivityTitle != null) {
|
|
||||||
getActivity().getActionBar().setTitle(mOldActivityTitle);
|
|
||||||
}
|
|
||||||
mToggleSwitch.setOnBeforeCheckedChangeListener(null);
|
mToggleSwitch.setOnBeforeCheckedChangeListener(null);
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
@@ -135,8 +128,7 @@ public abstract class ToggleFeaturePreferenceFragment
|
|||||||
public void setTitle(String title) {
|
public void setTitle(String title) {
|
||||||
final PreferenceActivity activity = (PreferenceActivity) getActivity();
|
final PreferenceActivity activity = (PreferenceActivity) getActivity();
|
||||||
if (!activity.onIsMultiPane() || activity.onIsHidingHeaders()) {
|
if (!activity.onIsMultiPane() || activity.onIsHidingHeaders()) {
|
||||||
mOldActivityTitle = getActivity().getTitle();
|
getActivity().setTitle(title);
|
||||||
getActivity().getActionBar().setTitle(title);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user