In my Android application I am trying to introduce a database of 18 tables and although I am finishing the process to introduce the DB in my app, I have already started looking at how to visualize the data of a table in a table RecyclerView
and to my surprise I have discovered that I have than use a RecyclerView
with a CursorAdapter
custom .
I know more or less that it is a cursor, but I can't find how to create a CursorAdapter
custom one to send the information from the DB table to the RecyclerView
.
I've been looking for information on the Internet and I can't find anything that details how to create it. I have only found libraries that have been created by other programmers, but I would not want to include external libraries if it can be done without them.
Could someone tell me how to create it so I can understand it?
I don't think more information is needed to provide an answer, but if not, write me a comment.
Thanks in advance.
I also avoid using libraries, in fact there are few that I use. In a project I have a similar implementation and this
CustomAdapter
is the one I use:CursorRecyclerViewAdapter.java
:MyListCursorAdapter.java
:Your adapter has to extend CustomRecyclerViewAdapter , this is the code link:
https://gist.github.com/skyfishjy/443b7448f59be978bc59