@NonNull Annotations not working in Android Studio

import android.support.annotation.NonNull; public @NonNull Result handleFollowForwardResult(@NonNull Result tempResult, @NonNull Result oldResult) { return null; } 

doesn't give any errors or warnings? Isn't that a matter of annotation?

+8
android android-studio
source share
1 answer

This works in my copy of Android Studio 0.8.11. Try the following:

  • If you are using an older version of Android Studio, update it.
  • Make sure Inspections > Constants and Exclusions is enabled.
  • In Inspections > Configure annotations, make sure that the Nullable annotations list includes android.support.annotation.Nullable and your NotNull annotations contains android.support.annotation.NonNull .
+7
source share

All Articles