将 recyclerview 与数据库一起使用 [英] Using the recyclerview with a database

查看:51
本文介绍了将 recyclerview 与数据库一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

目前没有可用的 RecyclerView.Adapter 的默认实现.

可能会随着正式发布,Google 会添加.

由于目前RecyclerView 不支持CursorAdapter,我们如何将RecyclerView 与数据库一起使用?有什么建议 ?

解决方案

如果您正在使用 CursorLoader 运行查询并且您想要 RecyclerView 而不是 ListView.

你可以试试我的CursorRecyclerViewAdapter:CursorAdapter in RecyclerView

Currently there is no default implementation of RecyclerView.Adapter available.

May be with the official release, Google will add it.

Since there is no support for CursorAdapter with the RecyclerView currently, how can we use a RecyclerView with a database ? Any suggestions ?

解决方案

If you are running a query with a CursorLoader and you want RecyclerView instead of ListView.

You can try my CursorRecyclerViewAdapter: CursorAdapter in RecyclerView

这篇关于将 recyclerview 与数据库一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆