I get an ActivityNotFoundException when I use this code:
public void addListenerOnButton3(){
button3 = (Button) findViewById(R.id.btnSettings);
button3.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
Intent intentSettings = new Intent("net.stuffilike.kanaflash.Settings");
showToast("Settings clicked,");
try{
startActivity(intentSettings);
}
catch(Exception e){
showToastL("Exception" + e);
}
return;
}
});
}
Fair enough, except I can't tell how it wants me to tell it where the Activity is. Here is the relevant section of the Manifest:
<activity
android:name="net.stuffilike.kanaflash.Settings"
android:label="@string/settings" >
<intent-filter>
<action android:name="android.intent.action.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
How can I be sure the compiler finds my Settings.java file? Oh, my package is named
package net.stuffilike.kanaflash;
try this
replace X with your current activity name ..