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

Getting Null Object error for a view inside a adapter

Here is the code from my app where i try to get venue list from the Foursquare API and display in a recyclerview searchRetrofitAcitivity.java public class searchRetrofitActivity extends AppCompatActivity { private static final String TAG =…
-1
votes
1 answer

How to fill AlertDialog's custom view with dynamic data

I'm building an Android app and when the user clicks on one of the items of my RecyclerView, an AlertDialog pops up that allows them to edit that item of the list. However I would like to display some information about the item they're editing on…
-1
votes
1 answer

change the value TextView change the values of other items into Custom Listview Android

I have a problem, changing from the buttons to increase the value of the quantity textview, in the list also change others that I am not interacting with. As you see in the image below in the left part is the beginning of the list to which the…
-1
votes
2 answers

Can't getTag() of itemview after scrolling anymore

here's what I wanna do: I want items in recyclerview to be highlighted when clicked once and back to normal when clicked again. so I have a recyclerview. naturally I have an adapter too. inside adapter is my viewholder class where I have an…
Dave Gee
  • 47
  • 1
  • 1
  • 10
-1
votes
1 answer

ArrayList> vs ArrayList
Will there be any problem if I use ArrayList> in place of ArrayList for populating a recyclerView? or am I the only weirdo present here? I have image links in each of the list items. Some also don't have any image…
-1
votes
1 answer

setText() method returning null in adapter class

I am implementing a card view on a map fragment so on implementing it, i used two sub classes that extends view holder class.so when i am calling .setText() method for the text View of one of the sub classes from the constructor of the main class…
-1
votes
1 answer

How to get data from specific rows only in RecyclerView?

I'm stuck on a little problem. When I click on a row in my RecyclerView, I'd like to change its color to some other color (i.e.: red). Then, if I click this row again, I would like to set its color back to the normal one (i.e.: white). Then, if I…
-1
votes
2 answers

ViewHolder in recyclerView register visible view position and not absolute view position

Intended behaviour: Hello I am using a recyclerView to display a grid of images, loaded from a List<> saved in the ViewAdapter. When the user clicks an image a new fragment is created and is given as argument the corresponding item in the List<>. I…
-1
votes
1 answer

RecyclerView: gives wrong position onClick of specific View of custom row

Desired Result Maintain scroll position and give right position on specific view of custom row. I am using RecyclerView in which I am trying to add on Demand Data on beginning of list as well as end of list. Fetching data through Scrolling bottom…
Sagar Shah
  • 4,272
  • 2
  • 25
  • 36
-1
votes
2 answers

How to pass a put extra value through Imagebutton called from Array Adapter in Android

I have a n Array Adapter with a viewHolder. Inside adapter I implement a imagebutton click listener which opens another activity. I want to pass an id to the second activity but it says it cannot resolve…
-1
votes
1 answer

viewHolder could not be cast by viewHolder

I'm trying to display 2 different item views depending on what I have in my Array list. Without the condition (if) there is no problem, but when I put the condition and so I have to deal with 2 viewHolders I get an error telling that viewHolder…
-1
votes
2 answers

How to change the list item color its clicked

How to change the list item color, when i click the list item it show the dialog box and i give some values in the dialog box it will be stored in the list item and also list item color need to changed
-1
votes
2 answers

RecyclerView Adapter :OnBindViewHolder

Why do we use something like this to populate the recyclerview with data? Can't we just create a simple array of string like String[] titles and display them, like in ListView? List< Information> data public void onBindViewHolder(MyViewHolder…
-1
votes
1 answer

Removing first row of a recyclerView

I just can't figure out why the first row of my RecyclerView is only showing the empty xml-Layout. It's just like the data for that row is empty. But i get 4 rows - even if i only have 3 data-records. . (row size is specified with…
-1
votes
3 answers

If statement for ViewHolder is returning false all everytime

back with yet another android question and feel as if I am missing something simple here. The viewholder gets the content in the specific field of the table from which the result is read. Now I would like to compare that result to a char to change…
user3731856