![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android 错误记录
amberoot_源狼乐
It isn't the burdens today that drive me mad,it is the regrets over yesterday and the fear of tomorrow.
展开
-
android之(ListView,RecycleView等)调用notifyDataSetChanged()界面不更新问题
之前做项目偶尔会出现这个问题,就是适配器Adapter绑定的数据源改变了,调用notifyDataSetChanged()方法,界面却没反应。然后我发现了问题所在,就是Adapter绑定的数据源的问题。 我以前的错误做法(界面不更新): 下面的栗子是刷新RecyclerView界面,我猜测由于初始化适配器myListAdapter绑定了myListData的内存地址,但更新数据时,myList...原创 2020-03-05 14:38:52 · 2040 阅读 · 0 评论 -
android error:java.lang.NullPointerException
error: java.lang.NullPointerException· 字符串变量未初始化; · 接口类型的对象没有用具体的类初始化,比如: List lt; 会报错 List lt = new ArrayList(); 则不会报错了 · 当一个对象的值为空时,你没有判断为空的情况。 if(dd!=null) String类型的对象可以做如下判断 if(s...转载 2018-03-16 11:35:05 · 440 阅读 · 0 评论