Pick up an item from RecyclerView and associate one class with another

0

This is the following, I'm making an app for reading books that counts as a final note, and I want to do this: after registering a book, I would like to add comments from it. When you touch a recyclerview item, the app opens another activity to add a comment.

The problem is that when you add more than one book, when you open the comment activity , it still shows the comment of the first book, and I think it would work fine by picking up an item (book) of recyclerview and associating it with the registered comment. The problem is I do not know how to do that. Could someone help me?

Note: To create the local database, I use objectbox .

Project Link Click here

    
asked by anonymous 28.02.2018 / 02:49

1 answer

0

You can use a Map to reference information according to the recycleview item you clicked and retrieve the value through get (Key), thereby creating a direct reference between the recycleview item and the comments belonging to it.

Or else you can pull the bank by joining the two information Book and your comments and the moment you feed the views feed the comments as well.

    
06.03.2018 / 06:29