For Android Studio:
Add the following to build.gradle :
dependencies { ... // For @Nullable/@NonNull compile 'com.android.support:support-annotations:+' }
Go to File / Settings β Project Settings β Inspections and search for βnullableβ.
Under constant conditions and exceptions and @ NotNull / @ Nullable problems, click Configure annotations and select Android annotations.
You can also check Recommend @Nullable annotations ... under Constant conditions and exceptions, or possibly change other parameters.
squirrel
source share