Cant create preferences activity in Android

Discussion in 'XML Forums' started by Tuchhoofe, Apr 10, 2013.

  1. Tuchhoofe

    Tuchhoofe New Member

    I am trying to make a preferences activity in android. What happens is you start the app and the you press the menu or settings button on your phone while in the app. Preferences should be on of the categories you can chose from. the problem is when I tap preferences the application crashes. Can someon please fix and repaste my code.\[code\]import android.os.Bundle;import android.preference.PreferenceActivity;public class Prefs extends PreferenceActivity{@Overrideprotected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.prefs);}}\[/code\]I am aware I am using a deprecated method, I tried going to the android.developers website and I couldnt find an answerHere is my XML:\[code\]<EditTextPreference android:title="EditText" android:key="name" android:summary="Enter Your Name" /><CheckBoxPreference android:title="CheckBox" android:defaultValue="http://stackoverflow.com/questions/15916453/true" android:key="checkbox" android:summary="check this box" /><ListPreference android:title="list" android:key="list" android:summary="This is a list to choose from" android:entries="@+array/list" android:entryValues="@+array/lvalues" ></ListPreference>\[/code\]
     

Share This Page