Editor flags onCreateOptionsMenu() / onOptionsItemSelected() as unknown
Steps to reproduce:
- Create an activity that extends
- Add code to implement
onCreateOptionsMenu(), calling super.
Expected result: The editor is happy and doesn't show any errors in the gutter bar.
Actual result: The
@Override annotation is flagged as a warning with
method does not override or implement a method from a supertype, and the call to super is flagged as an error with
cannot find symbol.
To be sure, the compiler is happy and the build succeeds. It's just the editor that barks.
If I open the same project in Android Studio it's fine.
I've noticed that other methods from the Activity class cause the same kind of problem when using AppCompatActivity. I haven't used Netbeans on my current project because of it.