I’m a beginner programmer so please bear with me. This app runs fine but when I try to open up a new class, the app force closes. Can someone please help me with this problem?
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_HELP:
Intent localIntent = new Intent();
localIntent.setClass(MyClass.this, Help.class);
startActivity(localIntent);
break; }
The Manifest Looks like:
<activity
android:name=".HELP"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Dialog" >
</activity>
I have tried multiple times with different ways to start an intent including
startActivity(new Intent(com.myapp.HELP));
and then setting up an intent filter but this proved fruitless as well.
Some additional information. In logcat, I get this error:
Unable to find explicit activity class {com.myapp/com.mayapp.Help}; have you declared this activity in your AndroidManifest.xml?
I have found other users who have found this problem, and they said it was a problem with eclipse, no the code. Is there anyone that can help with the eclipse problem?
Try this code
in Manifest: