package com.stoutner.privacybrowser;
import android.os.Bundle;
-import android.preference.PreferenceActivity;
+import android.support.v7.app.AppCompatActivity;
-// Once the minimum API is >= 11 we can switch from the deprecated PreferenceActivity to using a PreferenceFragment.
-public class SettingsActivity extends PreferenceActivity {
+public class SettingsActivity extends AppCompatActivity {
@Override
- // Until minumum API is >= 11 we needs to use the deprecated addPreferenceFromResource from PreferenceActivity.
- @SuppressWarnings("deprecation")
- public void onCreate(Bundle savedInstanceState) {
+ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- addPreferencesFromResource(R.xml.preferences);
+
+ // Display SettingsFragment.
+ getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
}
}