I am trying to remove this menu item based on what view I'm in as follows, but it always seems to believe it's true no matter what layout Id I compare the current one with:
- Code: Select all
@Override
public boolean onPrepareOptionsMenu(final Menu menu) {
if(this.getCurrentFocus() == this.findViewById(R.layout.settings)){
Log.d("DEBUG", "IN SETTINGS VIEW");
}
else{
Log.d("DEBUG", "NOT IN SETTINGS VIEW");
}
return super.onPrepareOptionsMenu(menu);
}

