Android: NullPointerException Working With SharedPreferences

前端 未结 3 2030
北恋
北恋 2021-01-23 21:12

Working with SharedPreferences, this activity crashes upon launching. First I\'ll post the activity code, and then I\'ll post my LogCat. Thank you so much guys, you guys are alw

3条回答
  •  借酒劲吻你
    2021-01-23 21:40

    Move the instantiation of the settings instance variable into your onCreate method. After the super.onCreate call.

    The way you are doing it now, it is getting set to null;

提交回复
热议问题