Skip to content
Advertisement

Why my bookmarked words doesn’t saved to sqlite database if i want to add them from another fragment?

The main problem is that when i add bookmark codes from direct recyclerview it works perfectly fine but when i add those codes to another fragment it just only show a toast that bookmark is added or deleted but that bookmarked word doesn’t show in favorite list.

Here is my Database codes

JavaScript

My RecyclerView codes

JavaScript

My Detalis Fragment codes

JavaScript

My Favorite Fragment codes

JavaScript

When i use bookmark codes from direct RecyclerView

When i use same bookmark codes from another fragment this happens

Any help will be heavily appreciated 🙏

Advertisement

Answer

Problem Solved

Just add those to RecyclerView

JavaScript

And add this codes to Fragment Class

JavaScript

*** You need to make you POJO class Parcelable to pass objects between fragments. ***

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement