Main Activity
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.menumenu, menu);
return true;
}
public void myClickHandler(View v)
{
switch(v.getId())
{
case R.id.resetscoreboard:
scoreboardreset();
topText.setText("Scoreboard Has Been Reset!!");
}
}
menumenu.xml
<item
android:id="@+id/resetscoreboard"
android:title="Reset Scoreboard"
android:orderInCategory="1"
android:onClick="myClickHandler">
</item>
Could you tell me why it does not do anything when I pull up the menu and click on it?
Thanks a lot, experts @ stack overflow!!
Instead of defining click Handler, you need to implement:
Go through this example to get exact idea for the implementation of Menu in Android.