I follow this guide: link text
Preferences.java:
public class Preferences extends PreferenceActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
}
}
PreferencesTutorial.java:
public class PreferencesTutorial extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button prefBtn = (Button) findViewById(R.id.prefButton);
prefBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent settingsActivity = new Intent(getBaseContext(),
Preferences.class);
startActivity(settingsActivity);
}
});
}
}
preferences.xml:

When the application starts, and I press the prefButton button, an error occurs: "The PreferencesTutorial application (PreferencesTutorial.com.examples process) has stopped unexpectedly. Please try again"
I did not find errors in the code. I would also like to show my philology if this helps:

AndroidManifest.xml:

What is wrong with the code?
Even if I add (where is the cursor)
<activity
android:name=".Preferences"
android:label="@string/set_preferences">
</activity>
I am still getting an error.
source
share