I\'m new to android/java programming and am confused how to properly deal with this warning.
Method invocation \'\' may produce \'Java.lang.NullPointe
Yes. Using if (Object != null){} for validating is the proper way. try {} catch (NullPointerException) {} is the next solution which is preferred in this case.
If you want to get ride of it, throw an NullPointerException. Lint will ignore it in this case. public void myFunc() throws NullPointerException{}.
Anyway, good Coding always means validating everything for a possible problem while runtime. Validating != null is just fine and should always be used whenever it's possible null.