/**
* Copyright 2016 Soren Stoutner <soren@stoutner.com>.
*
- * This file is part of Privacy Browser.
+ * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
*
* Privacy Browser is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
package com.stoutner.privacybrowser;
import android.os.Bundle;
-import android.preference.PreferenceActivity;
-import android.support.v7.widget.Toolbar;
+import android.preference.PreferenceFragment;
+import android.support.v7.app.AppCompatActivity;
+
+public class SettingsActivity extends AppCompatActivity {
-// Once the minimum API is >= 11 we can switch from the deprecated PreferenceActivity to using a PreferenceFragment.
-public class SettingsActivity extends PreferenceActivity {
@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.
+ PreferenceFragment settingsFragment = new SettingsFragment();
+ getFragmentManager().beginTransaction().replace(android.R.id.content, settingsFragment).commit();
}
}