Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot override the final method from ActionBarActivity

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 ?

like image 822
Michael Avatar asked Sep 03 '13 08:09

Michael


1 Answers

Instead of using onMenuItemSelected I used onOptionsItemSelected and the code compiled okay.

Can it be that onMenuItemSelected appears in the docs but not in the code ?

like image 105
Michael Avatar answered Oct 25 '22 21:10

Michael