Commutator expressions must be constant expressions
I am using ActionBarSherlock and then onOptionsItemSelected
to start a new action when a specific menu item has been selected. The code worked correctly before adding the ABS and now I am getting the error case expressions must be constant expressions
on case
.
@Override
public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item)
{
switch (item.getItemId()) {
case R.id.about: //error
startActivity(new Intent(this, AboutActivity.class));
break;
case R.id.feedback: //error
//launch activity
break;
default:
break;
return super.onOptionsItemSelected(item);
}
The same code worked great before adding ActionBarSherlock.
+3
source to share