android - Why is `noinspection SimplifiableIfStatement` automatically added to the activity created through the wizard -
my activity created through wizard hash following code:
@override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); //noinspection simplifiableifstatement if (id == r.id.action_settings) { return true; }
what piece of code here?
//noinspection simplifiableifstatement if (id == r.id.action_settings) { return true; }
without //noinspection simplifiableifstatement
, editor warns because simplified to:
return id == r.id.action_settings;
but that's not want here, need put in if
later (e.g. launch settings activity).
Comments
Post a Comment