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
Tag: android-recyclerview
Firebase data not displaying in Recycler view. How do I display user specific data from firebase in recyclerview?
I have attached the firebase data image at the bottom for reference. I have a list of users. In that few users have a node called Cart. I need to display the data in the cart for that specific user. Below is my Activity code Here is my adapter class Here is my Model class I have a list of
Android recycle view update sort list with concurrency issue
I have a sorted list I would like to use to hold objects for maintaining a recycleview as usual. The api I am interfacing with passes me updates through an interface callback using multiple threads. This api can add, remove or update object state. When the app opens there is a flurry of adds, removes and updates. Then it slowes
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
How to change a backgound of a button in recyclerview [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question I made a recyclerview and there is a button on myitem. I want to change its color when I click
Android RecyclerView content not updating after notifyItemInserted
I’ve got a RecyclerView that needs to update in real-time when content is received. It successfully shows all the content at first load. When attempting to add a new item dynamically, it makes no difference. Is there anything I’m doing wrong here? Much appreciated! MainActivity: Adapter: Standard adapter code. Simply shows all the items in the recyclerview. Answer Since you