Im my application I inflate different menu resources, like this:
public boolean onCreateOptionsMenu(Menu menu) {
_menu = menu;
if (/* CONDITION */) {
getMenuInflater().inflate(R.menu.menu_activity_detail, _menu);
} else {
getMenuInflater().inflate(R.menu.menu_empty, _menu);
}
return true;
}
before this I save the Menu
object for further reuse, like inflating a new menu under specific circumstances.
Now the question: is there any way to know which resource I've inflated at the creation of my activity, without manually saving the id of R.menu.menu_res
?