MenuOverride
@Overridepublic boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_next, menu);
if (!check)
{
MenuItem item = menu.findItem(R.id.menu_next);
item.setVisible(false);
invalidateOptionsMenu();
}
else if(check)
{
MenuItem item = menu.findItem(R.id.menu_next);
item.setVisible(true);
invalidateOptionsMenu();
}
return true;
}
Void Function()
{
Do what you want
call==>
check=true;
invalidateOptionsMenu();
}
Comments
Post a Comment