1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.example.notificationshowcase; 18 19 import android.app.Activity; 20 import android.os.Bundle; 21 import android.preference.PreferenceFragment; 22 23 public class SettingsActivity extends Activity { 24 public static final String KEY_GLOBAL_FADE = "pref_key_global_fade"; 25 public static final String KEY_SMS_ENABLE = "pref_key_sms_enable"; 26 public static final String KEY_SMS_NOISY = "pref_key_sms_noisy"; 27 public static final String KEY_SMS_SOUND = "pref_key_sms_sound"; 28 public static final String KEY_SMS_BUZZY = "pref_key_sms_buzzy"; 29 public static final String KEY_SMS_ONCE = "pref_key_sms_once"; 30 public static final String KEY_SMS_PRIORITY = "pref_key_sms_priority"; 31 public static final String KEY_SMS_PERSON = "pref_key_sms_person"; 32 public static final String KEY_PHONE_ENABLE = "pref_key_phone_enable"; 33 public static final String KEY_PHONE_NOISY = "pref_key_phone_noisy"; 34 public static final String KEY_PHONE_FULLSCREEN = "pref_key_phone_fullscreen"; 35 public static final String KEY_PHONE_PERSON = "pref_key_phone_person"; 36 public static final String KEY_UPLOAD_ENABLE = "pref_key_upload_enable"; 37 public static final String KEY_TIMER_ENABLE = "pref_key_timer_enable"; 38 public static final String KEY_CALENDAR_ENABLE = "pref_key_calendar_enable"; 39 public static final String KEY_SOCIAL_ENABLE = "pref_key_social_enable"; 40 public static final String KEY_INBOX_ENABLE = "pref_key_inbox_enable"; 41 public static final String KEY_PICTURE_ENABLE = "pref_key_picture_enable"; 42 43 public class SettingsFragment extends PreferenceFragment { 44 @Override 45 public void onCreate(Bundle savedInstanceState) { 46 super.onCreate(savedInstanceState); 47 addPreferencesFromResource(R.xml.preferences); 48 } 49 50 public SettingsFragment() {} 51 } 52 53 @Override 54 protected void onCreate(Bundle savedInstanceState) { 55 super.onCreate(savedInstanceState); 56 getFragmentManager().beginTransaction() 57 .replace(android.R.id.content, new SettingsFragment()) 58 .commit(); 59 } 60 } 61