Hello Folks! My problem is, that I have got a TabActivity, which has 4 Tabs right now. The first Tab is a special Details-Tab, where the user could modify some data.
The problem is, that if I add a OptionsMenu for the Activity, that the OptionsMenu is appearing on every Tab. I tried to check the current mTabHost.getCurrentTabTag() in the onCreateOptionsMenu but that changed nothing. So, how to do that?
(The following code, which still shows the OptionsMenu on every Tab)
public boolean onCreateOptionsMenu(Menu menu) {
if(mTabHost.getCurrentTabTag()==getString(R.string.tab_details)) {
boolean result = super.onCreateOptionsMenu(menu);
menu.add(0, EDIT_ID, 0, R.string.menu_edit).setIcon(R.drawable.edit);
return result;
}
return true;
}
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch (item.getItemId()) {
case EDIT_ID: {
Toast.makeText(this, "o.O", Toast.LENGTH_LONG).show();
}
}
return super.onMenuItemSelected(featureId, item);
}