cr5315
Android Enthusiast
I've been trying to figure out what is keeping the reason why the menu won't launch a new activity. All the other options in the menu work just fine, INCLUDING one that "reloads" the page by launching the main activity again and calling finish() on the first one. I'e tried every example on developer.android.com and many others online, but none of them have worked.
Eclipse is giving me this when I click on the menu option on my phone.
Here's the part of the code for the menu
menu.xml
And the activity I'm trying to launch
Eclipse is giving me this when I click on the menu option on my phone.
Here's the part of the code for the menu
Code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.Reload:
Intent reloadIntent = new Intent(this, AndroidRssReader.class);
startActivity(reloadIntent);
finish();
break;
case R.id.About:
Intent myIntent = new Intent (this, About.class);
startActivity(myIntent);
break;
case R.id.Exit:
finish();
break;
}
return true;
}
menu.xml
Code:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/Reload"
android:title="Reload"
android:orderInCategory="1" />
<item android:id="@+id/About"
android:orderInCategory="2"
android:title="About" />
<item android:id="@+id/Exit"
android:orderInCategory="3"
android:title="Exit" />
</menu>
And the activity I'm trying to launch
Code:
package com.bba.virusexperts;
import android.os.Bundle;
public class About extends AndroidRssReader {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
}
}