Merge "Update activity titles for fragments without preference screen."
This commit is contained in:
committed by
Android (Google) Code Review
commit
471bc86ae6
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.settings.applications;
|
||||
|
||||
import android.annotation.StringRes;
|
||||
import android.annotation.Nullable;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceFrameLayout;
|
||||
@@ -37,6 +37,14 @@ public class BackgroundCheckSummary extends InstrumentedPreferenceFragment {
|
||||
return MetricsEvent.BACKGROUND_CHECK_SUMMARY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (usePreferenceScreenTitle()) {
|
||||
getActivity().setTitle(R.string.background_check_pref);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// initialize the inflater
|
||||
@@ -59,10 +67,4 @@ public class BackgroundCheckSummary extends InstrumentedPreferenceFragment {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
@StringRes
|
||||
protected int getTitle() {
|
||||
return R.string.background_check_pref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.android.settings.applications;
|
||||
|
||||
import android.annotation.StringRes;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -44,6 +43,10 @@ public class RunningServices extends SettingsPreferenceFragment {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
if (usePreferenceScreenTitle()) {
|
||||
getActivity().setTitle(R.string.runningservices_settings_title);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,12 +112,6 @@ public class RunningServices extends SettingsPreferenceFragment {
|
||||
mOptionsMenu.findItem(SHOW_BACKGROUND_PROCESSES).setVisible(!showingBackground);
|
||||
}
|
||||
|
||||
@Override
|
||||
@StringRes
|
||||
protected int getTitle() {
|
||||
return R.string.runningservices_settings_title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.RUNNING_SERVICES;
|
||||
|
||||
Reference in New Issue
Block a user