Editor flags onCreateOptionsMenu() / onOptionsItemSelected() as unknown
Steps to reproduce:
- Create an activity that extends
android.support.v7.app.AppCompatActivity
. - 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.
Comments (4)
-
reporter -
I think this is similar to what I am seeing. In the support library, AppCompatActivity inherits from FragmentActivity, which inherits from BaseFragmentActivityJB.
When you look inside the build/intermediates folder, BaseFragmentActivityJB is not contained in the main classes.jar in support-fragment-{version}.aar
Instead it is contained inside libs/internal_impl-{version}.jar in the aar
Hence NetBeans cannot see any of the superclasses beyond FragmentActivity, thus red wavy lines everywhere.
NbAndroid probably needs to look inside these libs/ jars in order to fix this problem.
-
reporter Good to know I'm not the only one seeing this!
-
I have the same issue but with android.support.v4 Tried to clean cache, but it didn't help
- Log in to comment