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.
Old way as followed:
listview.setAdapter(cursorAdapter)
in this way, I can get the cursor to deal with data in database
but now, recycleview.setAdapter(recycleview.adapter)
it doesn't recognize the adapter extending BaseAdapter
so anyone can give me a hand?
The new
RecyclerView
works with a newRecyclerView.Adapter
base class. So it doesn't work with theCursorAdapter
.Currently there is no default implementation of
RecyclerView.Adapter
available.May be with the official release, Google will add it.
Implementing it yourself is actually quite simple: