2 * SaveMySugar - Exchange messages using the distance between phone calls
4 * Copyright (C) 2015 Antonio Ospite <ao2@ao2.it>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 package it.ao2.savemysugar;
22 import android.os.Bundle;
23 import android.support.v7.app.ActionBar;
24 import android.support.v7.app.AppCompatActivity;
25 import android.support.v7.preference.PreferenceFragmentCompat;
26 import android.support.v7.widget.Toolbar;
28 public class SettingsActivity extends AppCompatActivity {
31 public void onCreate(Bundle savedInstanceState) {
32 super.onCreate(savedInstanceState);
33 setContentView(R.layout.activity_settings);
35 Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
36 setSupportActionBar(toolbar);
38 ActionBar ab = getSupportActionBar();
39 ab.setDisplayHomeAsUpEnabled(true);
41 getSupportFragmentManager().beginTransaction().replace(R.id.content_wrapper_settings, new MyPreferenceFragment()).commit();
44 public static class MyPreferenceFragment extends PreferenceFragmentCompat {
47 public void onCreatePreferences(final Bundle savedInstanceState, String s) {
48 addPreferencesFromResource(R.xml.preferences);