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
0
votes
3 answers

ListView Position Issue in getView(...)

I have three Items in a ListView, and on each and every list item i have three TextView(s), one contains item price, second to show Quantity and third to show Total of that item. Also two more TextView(s), one to increase the quantity and second to…
Sun
  • 6,768
  • 25
  • 76
  • 131
0
votes
1 answer

Baseadapter with ViewHolder, crashes on Scroll

i am using a listview with baseadapter and on scroll of the listview it crashes. My getView method of the BaseAdapter class @Override public View getView(final int arg0, View arg1, ViewGroup arg2) { // TODO Auto-generated method stub …
Jeffy Lazar
  • 1,903
  • 13
  • 20
0
votes
2 answers

Example of implementing ViewHolder with multiple layouts

I managed to implement ViewHolder in my adapter but since I am rather new to this, I am not sure if the following implementation is correct. I have 10 elements in my array at the moment but I spent around 3-4 minutes debugging and I'm not sure I…
Alex
  • 108
  • 1
  • 11
0
votes
1 answer

No data inside the custom adapter

This code is from slidenerd tutorial for recyclerview im trying to bind the data to the recyclerview using getdata function public static List getData() { List menuData=new ArrayList<>(); int[]…
0
votes
0 answers

Getting null when calling class method of type list

i have the following api response "stories": [ { "id": 754, "title": "what ever bla bla bla", - "feed": [ { "feed_id": "2", "title": "cnn", …
Faiz
  • 51
  • 3
  • 12
0
votes
2 answers

Grid view view holder set wrong image when scrolling

Problem: An ImageView is changed in a GridView cell after scrolling it. It works fine without a ViewHolder. Here a food icon changes to the last item, which was as default. // Grid view Adapter public class FlagTypAdapter extends BaseAdapter…
Rax
  • 1,347
  • 3
  • 20
  • 27
0
votes
5 answers

Using ViewHolder With ListView

I am using ListView to List text and images but I want to use ViewHolder to make the scrolling more smooth I have tried but can't quite get it right how must I modify the code The way I have tried some of my images doesn't show up @Override public…
Jacques Krause
  • 5,523
  • 9
  • 27
  • 43
0
votes
1 answer

In a ViewHolder's View with a Listener, how to modify the data it represents?

I have a ViewHolder than contains, among other widgets, a SeekBar. The SeekBar has a Listener, which is added during the onCreateViewHolder call. Since the onBindViewHolder method is used to configure the Views held by the ViewHolder, how can that…
Daniel F
  • 13,684
  • 11
  • 87
  • 116
0
votes
1 answer

Speeding up performance of multiple listviews in the same fragment

For understanding the structure I will be talking about, first see this example picture: I need to show multiple ListViews in one fragment. The problem is when opening the given fragment, inflating the views takes quite a lot of time,…
0
votes
0 answers

Using holder variable inside an onClickListener method in ListViewAdapter

For the ListView I have made the holder object and everything. Initializing it if the convertView is null, else getting the tag. I am programmatically adding an ImageView to the List Row based on some conditions. That also I am adding in the…
0
votes
0 answers

Listview can't render bitmap in Imageview using ViewHolder Pattern

Its very weird, but true. I am using ViewHolder pattern to increase the list performance. getView() method has bitmap, but the below code can't render the bitmap in the imageview of listview item. if (convertView == null) { convertView =…
0
votes
0 answers

List adapter unchecking my toggle button when I scroll. Tried multiple solutions from here but no luck

my adapter (the style of which has been working for the rest of my app) is now giving me issues. This is the first list that has a toggle-able button. Each listItem has a toggleButton, which when I toggle, scroll down and then back up, it becomes…
0
votes
4 answers

View is recycling even by using a view-holder

So I have created a custom listview of which one item uses this layout:
Mohammad Areeb Siddiqui
  • 9,795
  • 14
  • 71
  • 113
0
votes
2 answers

Does not scroll smooth when fastScrollEnabled is used in ListView

I am using a listview in my app. I made a custom adapter and used viewholder design pattern. The problem is when I scroll the listview by swiping its scroll smoothly but when I scroll it by dragging the fastscroll thumb it lags too much. It freezes…
Tushar Monirul
  • 4,944
  • 9
  • 39
  • 49
0
votes
1 answer

App is crashing on scrolling of list

In my app I am displaying map and list of items. I am using google place api to fetch nearest places and showing on map as markers having name and vicinity and as well as list. Here is my code GooglePlacesActivity.java import…
aquib
  • 194
  • 2
  • 13