Proper way to handle Android Studio's NullPointerException lint warning
I'm new to android/java programming and am confused how to properly deal with this warning. Method invocation '' may produce 'Java.lang.NullPointerException' Should I be ussing assert to remove the warning? Or rather a runtime exception? Any help would be appreciated. matiash I doubt this question can be answered conclusively, as it's a matter of opinion. Or at least I believe so -- an opinion too. :) I understand you want "0 warnings" (a very laudable goal) but there's probably not a "one size fits all" issue. That said... Things I believe you should not do: Use assert . While you can add an