7

I'm in the process of migrating from ActionBarSherlock to ActionBarCompat library that was introduced in Google IO 2013 (I do this so I can use ActionBarDrawerToggle).

I have already sorted out all the necessary dependencies (AppCompat, latest support library...), fixed all the imports but now when I try to use ActionBarActivity's onMenuItemSelected I get an error.

@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    ...
}

Error:

Cannot override the final method from ActionBarActivity

The original method from ActionBarActivity (inherited from FragmentActivity) is final. When I used ABS, this was working, now I can't override the method.

(MenuItem is of class android.view.MenuItem and not the compat version...)

Am I missing something ?

4

1 回答 1

12

而不是使用onMenuItemSelected我使用onOptionsItemSelected和编译好的代码。

会不会onMenuItemSelected出现在文档中而不出现在代码中?

于 2013-09-03T11:37:16.400 回答