android simpleadapter可以重新填充吗?如何清除?
展开全部
你随便放的什么数据,把数据放进去后
SimpleAdapter simpleAdapter;
simpleAdapter.notifyDataSetChanged();
simpleAdapter.notifyDataSetInvalidated();
调这两个方法,源码在下边,然后再通知adapter相对应的组件更新就可以啦。
/**
* Notifies the attached View that the underlying data has been changed
* and it should refresh itself.
*/
public void notifyDataSetChanged() {
mDataSetObservable.notifyChanged();
}
public void notifyDataSetInvalidated() {
mDataSetObservable.notifyInvalidated();
}
SimpleAdapter simpleAdapter;
simpleAdapter.notifyDataSetChanged();
simpleAdapter.notifyDataSetInvalidated();
调这两个方法,源码在下边,然后再通知adapter相对应的组件更新就可以啦。
/**
* Notifies the attached View that the underlying data has been changed
* and it should refresh itself.
*/
public void notifyDataSetChanged() {
mDataSetObservable.notifyChanged();
}
public void notifyDataSetInvalidated() {
mDataSetObservable.notifyInvalidated();
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询