Skip to content

Tag: android-recyclerview

Why does the Recycleview work differently when I start it or when I go back to it from an other activity?

I try to create a Shopping/ToDoList application where the items are contained in SharedPreferences. When I start the application, and I choose what I want to execute, Shopping list part or ToDoList part, then the java code fetches the existing data from the SharedPreferences and give to the RecycleView to create and show a list. It seems works totally correct,

Incorrect displaying items in RecyclerView while scrolling

Could you please assist in following issue: I have incorrect displaying items in my messenger app. My layout for items: My layout for dialog activity: Class DialogActivity Adapter class In this place I check user name. If user name is my name then I set message and visible to holder.messageMyMessage. Else I set message and visible to holder.messageYourMessage. But sometimes

Firestore – RecycleView – Image holder

I don’t know how to write a holder for an image. I already have 2 texts set, but I don’t know what the holder for the image should look like. Can you help me tell what the writeup for the image should look like in order for it to appear correctly? My code: Answer You can use a library like

recyclerViewAdapter.getItemCount() returning 0 even when it has objects inside?

I’m building a Fragment with a RecyclerView which displays notices retrieved from my database. Everything works fine, except for this line of code: Problem: recyclerViewAdapter.getItemCount() This statement returns 0 even if the RecyclerViewAdapter has elements present. The full scenario is whenever the fragment loads, the Toast with the appropriate message pops up, but then after a slight delay, the first