Process: com.weather.com.welcomeactivity, PID: 8304 java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference at com.weather.com.welcomeactivity.utils.CacheUtils.getString(CacheUtils.java:46) at com.weather.com.welcomeactivity.shoppingcart.utils.CartProvider.getDataFromLocal(CartProvider.java:73) at com.weather.com.welcomeactivity.shoppingcart.utils.CartProvider.getAllData(CartProvider.java:66) at com.weather.com.welcomeactivity.shoppingcart.utils.CartProvider.listToSparse(CartProvider.java:44) at com.weather.com.welcomeactivity.shoppingcart.utils.CartProvider.<init>(CartProvider.java:32) at com.weather.com.welcomeactivity.shoppingcart.utils.CartProvider.getInstance(CartProvider.java:38) at com.weather.com.welcomeactivity.app.GoodsInfoActivity.onClick(GoodsInfoActivity.java:163) at android.view.View.performClick(View.java:5637) at android.view.View$PerformClick.run(View.java:22429) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
1 回答
已采纳
qq_2雨水_04090191
TA贡献1条经验 获得超0个赞
NullPointerException,这个单词的意思就是说你的代码运行到某一步的时候报空指针异常了,后面那些就是说的是你代码的行数,哪一行有问题。
- 1 回答
- 0 关注
- 839 浏览
添加回答
举报
0/150
提交
取消