1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * 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, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16 17 package com.example.android.voicerecognitionservice; 18 19 import android.os.Bundle; 20 import android.preference.PreferenceActivity; 21 22 /** 23 * A settings activity for the sample voice recognizer. 24 */ 25 public class VoiceRecognitionSettings extends PreferenceActivity { 26 27 // The name of the SharedPreferences file we'll store preferences in. 28 public static final String SHARED_PREFERENCES_NAME = "VoiceRecognitionService"; 29 30 // The key to the preference for the type of results to show (letters or numbers). 31 // Identical to the value specified in res/values/strings.xml. 32 public static final String PREF_KEY_RESULTS_TYPE = "results_type"; 33 34 // The values of the preferences for the type of results to show (letters or numbers). 35 // Identical to the values specified in res/values/strings.xml. 36 public static final int RESULT_TYPE_LETTERS = 0; 37 public static final int RESULT_TYPE_NUMBERS = 1; 38 39 @Override onCreate(Bundle savedInstanceState)40 public void onCreate(Bundle savedInstanceState) { 41 super.onCreate(savedInstanceState); 42 getPreferenceManager().setSharedPreferencesName(SHARED_PREFERENCES_NAME); 43 addPreferencesFromResource(R.xml.preferences); 44 } 45 } 46