Proper way to handle Android Studio's NullPointerException lint warning

后端 未结 8 1995
终归单人心
终归单人心 2020-12-16 09:41

I\'m new to android/java programming and am confused how to properly deal with this warning.

Method invocation \'\' may produce \'Java.lang.NullPointe

8条回答
  •  失恋的感觉
    2020-12-16 10:18

    I started to use

    @SuppressWarnings("ConstantConditions")

    on simple methods where I'm sure that the id is not null.

提交回复
热议问题