Contentprovider,CursorAdapter更新数据后自动刷新ListView
2016-10-16 14:37
1111 查看
1.在Contentprovider的query方法中加入一个通知uri
查询完数据库后得到一个cursor,cursor.setNotificaionUri(contentResolver, uri);
2.在insert,delete,update方法中通知改变
contentResolver.notifyChange(uri, null);
相关文章推荐
- 【android】Cursor记录集游标、ListView和SimpleCursorAdapter、ListView数据动态更新
- [小坑]调用CursorAdapter中的notifyDataSetChanged后,对应绑定的ListView没有自动刷新
- 解决SimpleCursorAdapter不能自动更新的问题
- 关于ListView中notifyDataSetChanged()刷新数据不更新原因
- android基础笔记——监听数据变化,即时更新ListView:adapter.notifyDataSetChanged();
- 关于ListView中使用自定义Adapter及时更新数据
- Android的ListView,数据更新后自动scroll到底部。
- XMLHTTP无刷新自动实时更新数据
- 第十五讲-----SimpleAdapter 封装复杂数据,ListActivity 类,ListView 事件,自动文本提示组件 AutoCompleteTextView
- ListView数据更新后,自动滚动到底部(聊天时常用)| Listview Scroll to the end of the list after updating the list
- 关于ListView中notifyDataSetChanged()刷新数据不更新原因
- 不使用cursoradapter的listview刷新方式(simpleadapter的remove刷新)
- 关于ListView中notifyDataSetChanged()刷新数据不更新原因
- ios:UITableView告别手动上拉更新,自动刷新数据
- 利用xmlhttp无刷新自动实时更新数据
- 关于ListView中notifyDataSetChanged()刷新数据不更新原因
- 子Dialog Activity更新记录后,刷新父Activity的Listview(跨Activity更新数据)
- Android ListView SimpleAdapter ArrayList 数据更新问题
- 关于ListView中notifyDataSetChanged()刷新数据不更新原因
- 使用SimpleCursorAdapter的ListView如何更新显示