Skip to content
Advertisement

Tag: android-recyclerview

How to startActivity within RecyclerView CustomAdapter

I want to add startActivity() to my onClick listeners in my CustomAdapter class. CustomAdapter.java: The problem is I’m getting the following error in my IDE: Initially , I thought this was happening because my CustomAdapter class was static. So, I made it non-static. But, the problem still persists. Pls guide me on making this intent work. Answer In you customer

Child RecyclerView setadapter doesn’t work on my Nested RecyclerView Android

I have two RecyclerViews. Parent RecyclerView works perfectly but the setadapter of the child’s in the parent adapter does not work. I tried to make some log messages in the child adapter but they didn’t even appear so the adapter is not even starting Below is the piece of code for better understanding. MainFragment.java ParentAdapter.java ChildAdapter.java Answer That is because

How to get id data from database deleting – setOnLongClickListener ERROR

I have a recyclerview and sql lite database. I keep city names in SQLite database and display them in recyclerview. When the city is setOnclickListener in the recyclerview, the city’s weather is shown and I do this by taking the city’s id from the sql lite database. arrayList.get(position).id it worked in setOnClickListener but it doesnt work setOnLongClickListener I want to

How to make a custom-shaped Recycler View?

I need to make a recycler view whose elements will wrap around the ImageView (like this: https://imgur.com/a/7NpCHri). Is there a way to implement this? Answer You can create adapter with GridLayoutManager and for items with indexes 6, 7, 10, 11 make empty transparent views. But as it were said in comment it is not appropriate use of RV. Maybe it

How to display already checked checkboxes in recyclerview, on activity start-up(many to many relationship)

Each “Note” is differently “added” to “Folders” or should I say, different checked “Folders” for each “Note”. When I check the “Folder”, go back to previous Notes activity with back button, then open the same “Note” to go to “Add to Folders Activity” and add the “Note” to Folders, it should remember that previously checked “Folder” and recheck it. I

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 My RecyclerView codes My Detalis Fragment codes My

Advertisement