I\'m new to android/java programming and am confused how to properly deal with this warning.
Method invocation \'\' may produce \'Java.lang.NullPointe
What @Herrbert74 suggested it surely working fine, but sometimes it's better to not add a @SuppressWarnings("ConstantConditions")
to an entire method (if it's not trivial), a better approach could be to use //noinspection ConstantConditions
on the warned line.
Those are my rules of thumb:
Use
@SuppressWarnings("ConstantConditions")
when the method is simpleUse
//noinspection ConstantConditions
when the method is complex and you need to remove the warning only on a specific line