是否有可能作出的CursorAdapter在recycleview设置,就像ListView的?就像、有可能、recycleview、CursorAdapter

2023-09-05 05:38:07 作者:╮╭

我没有谷歌退出解决方案到现在为止,以取代列表视图在我的项目,因为我需要使用游标与sqlite的链接。

I didn't google out a solution till now to replace listview in my project, because I need to use the cursor linked with the sqlite.

作为遵循旧的方式: listview.setAdapter(CursorAdapter的)这样,我可以让光标以处理数据库中的数据。

Old way as followed: listview.setAdapter(cursorAdapter) in this way, I can get the cursor to deal with data in database

但现在, recycleview.setAdapter(recycleview.adapter)不承认扩大BaseAdapter适配器

but now, recycleview.setAdapter(recycleview.adapter) it doesn't recognize the adapter extending BaseAdapter

所以任何人都可以给我个忙吗?

so anyone can give me a hand?

推荐答案

RecyclerView 适用于新的 RecyclerView.Adapter 基类。 因此,它不工作的CursorAdapter

The new RecyclerView works with a new RecyclerView.Adapter base class. So it doesn't work with the CursorAdapter.

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

可能与正式发布后,谷歌将其添加。

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