Skip to content

Tag: android-recyclerview

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

Why is my app Crashing with RecyclerView?

I’m doing a recycler method in my android studio project but i have a problem. Everytime i’m trying to findViewById my application is crashing. And i don’t understand why because i’m creating my view in the good way. And i’m trying to continue with that But i’m crashing at the line recyView = view.findViewById(;. My is not empty. And