Questions tagged [android-viewholder]

A ViewHolder object stores each of the component views inside the tag field of the Layout, so you can immediately access them without the need to look them up repeatedly. The ViewHolder pattern is often used in Android applications to improve performances of view access.

A ViewHolder object stores each of the component views inside the tag field of the Layout, so you can immediately access them without the need to look them up repeatedly. The ViewHolder pattern is often used in Android applications to improve performances of view access.

For an example, check the official Android documentation on the ViewHolder pattern.

1064 questions
-1
votes
2 answers

View resets after scrolling in RecyclerView

I am implemeting multiple selection on GridManager using RecyclerView. Here is my code inside adapter imgStamps.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { …
Vir Rajpurohit
  • 1,869
  • 1
  • 10
  • 23
-1
votes
1 answer

NullPointerException on toolbar in a RecyclerView

I am building a social media type app and for the main feed, I am using a CardView with a Toolbar inside to easily give me the ability to add an options menu for removing, editing, or reporting a post. I have the function to launch a profile…
-1
votes
3 answers

How delete a row of recycler view from ViewHolder

thanks to stop by. Not a long time ago someone explain to me that you should'nt store data in ViewHolder, I get why. But then it complicate something. I want to remove a Row if user click on a button inside the row. So i need to access the adapter.…
TomJouin
  • 49
  • 10
-1
votes
1 answer

is there any third party library or any component given by Android to show images like fb feed?

i got the list of images from gallery, now how to put images in single item like grid as facebook or other apps does?
-1
votes
1 answer

2 view holder in recycler adapter

I am new to android development. So sorry if this is useless question. I have RecyclerView like I want to display image and video from Firebase in RecyclerView. I have two ViewHolder. What I want is, adapter to check the post "type". If the …
user9822291
-1
votes
4 answers

Cannot resolve symbol in (RecyclerView)findViewById(R.id.xxx)

I want to create a food menu using RecycleView by connecting to firebase, I have declared recycler_menu as variable, but when i type recycler_menu = (RecyclerView)findViewById(R.id.recycler_menu); there are error showing cannot resolve symbol …
-1
votes
1 answer

Can't set custom typeface inside ViewHolder

I've tried everything that I could find on stackoverflow but nothing seems to work. The problem is that I cant change the font of any TextView inside my CardViewLayout. I've tried font family, text appearance in xml I've changed it by doing this,…
-1
votes
1 answer

How to update an item on a recyclerview after excuting AsyncTask doInBackground?

I'm creating a chat feature for an application and it works super fine. But I would like to show the user that message has been sent or it still wating for the server's response. Fields: List chatMessages; ChatAdapter…
-1
votes
1 answer

Android RecyclerView Adapter : update already drawn item view in the click listener for current itemview

So I have a quiz app, in which I present the user with a question and four options. The 4 options are given in a RecyclerView, so I am passing the 4 options(as string ArrayList) and the correct answer(string) to the RecyclerView adapter…
Navneet Krishna
  • 5,009
  • 5
  • 25
  • 44
-1
votes
1 answer

Cannot Cast Holder - ListView

I have a problem in Android, and Ive tried a couple of solutions, but nothing work. When I scroll the list I get the exception: java.lang.ClassCastException: com.example.restaurante.SmartMercadoriasAdapter$FirstViewHolder cannot be cast to…
-1
votes
1 answer

Show and hide card views

My application sources a list of dates and names from my Database and then displays the name in one card view and the date in another just above it and this continues for every record. I then decided that it makes sense for only one date to be shown…
-1
votes
1 answer

SetText inside OnCreateViewHolder sets text on more than one item

When i click the increment sign on the item, it should increment the number for only that item i clicked at. However, i scroll down and i find some other items are incremented as well. Here is my code public class CartAdapter extends…
-1
votes
1 answer

Adding two ViewHolders together in a recyclerView

I'm using a Fragment which is a gallery which shows you the thumbnails of the videos selected from my custom video gallery. I've used a button in the gallery which helps you to move from the fragment to the activity you select some videos and then…
Alok
  • 8,452
  • 13
  • 55
  • 93
-1
votes
1 answer

Change text's color for all cards in RecyclerView

I have to do the following thing: when a user clicks a button, I need to change the title's color for all cards in RecyclerView. I've been searching and searching and I couldn't find something to help me, except this method:…
Andrei Pascale
  • 232
  • 1
  • 3
  • 16
-1
votes
2 answers

Android Problems with onClickListener in Adapter

I've spent hours searching for a solution but everything I've tried doesn't work, it simply yields the same results as the code below does. I am trying to have an onClickListener change the visibility of a TextView but this code always sets the one…