Hello all, going through Bucky's tutorial and it is a bit outdated, I've been able to figure out most issues but am running into a brick wall with the idea of the preference fragment. My program is crashing every time I click on preferences. Here is my code
Prefs.java:
prefs.xml:
Inside my Menu.java I have:
Any ideas?
Thanks!
Prefs.java:
Code:
package com.example.testapp;
public class Prefs extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.prefs);
}
}
prefs.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<EditTextPreference
android:key="name"
android:summary="Enter Your Name"
android:title="EditText" />
</PreferenceScreen>
Inside my Menu.java I have:
Code:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Intent p = new Intent("com.example.testapp.PREFS");
startActivity(p);
return false;
}
Any ideas?
Thanks!