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
1 answer

How can I pass data from container activity to custom adapter

I am in the following situation: I have the default implementation of the navigation drawer from Android Studio with a navigationDrawerFragment. I have a custom listView for this navigationDrawerFragment with a custom adapter. Since I have…
ArnaudToutain
  • 178
  • 2
  • 3
  • 12
0
votes
1 answer

Problems with viewholder in a listview with checkbox

i'm trying to implement a listview with a checkbox. the listener works well, i can see which item is selected buti have a problem in this class because cb.getTag() returns null. private class MyCustomAdapter extends ArrayAdapter { …
wiki
  • 299
  • 4
  • 16
0
votes
2 answers

Android ViewHolder with remote ImageView

I Have implemented ViewHolder pattern im my adapter, where I have an ImageView populated with a remote image, the problem is when I scroll I always get a wrong image before having the correct one (after a fiew ms), I guess it is due to the fact that…
TootsieRockNRoll
  • 3,218
  • 2
  • 25
  • 50
0
votes
2 answers

Button in a listview with holder pattern

I have a listview that contains a botton in each row. The button open a dialog for single value choice when clicked. The thing is when I move down the list, values in the buttons are moving. The first value is repeated each 8 rows. Here is my…
Juliatzin
  • 18,455
  • 40
  • 166
  • 325
0
votes
1 answer

Navigation Drawer items repeating

I am using a navigation drawer with the listview layout. The items to be populated in the listview are textviews, radiobuttons and checkboxes. The xml layout file is as below.
0
votes
2 answers

android ListView with holder pattern on update item flicker

I created a listView with Base Adapter who implements ViewHolder Pattern. Each item from listview have a countdownTimer. Works fine, but if i want to update listview countDownTimer is flickering beetween new value and old value. How to resolve this…
ovluca
  • 291
  • 1
  • 15
0
votes
1 answer

RecylerView modify single view

In the new Android RecyclerView has someone a way to access and modify the single views based on the position ? @Override public void onBindViewHolder(RecycleHourAdapter.ViewHolder viewHolder, int position) { …
nstrelow
  • 489
  • 1
  • 5
  • 9
0
votes
1 answer

Android passing data on drag

What is the full-proof way of passing data with drag and drop? In my situation I have two lists and i can drag element from one to another. So the list from which we drag already has data associated with it. From what I have searched the usual way…
ak7483
  • 187
  • 1
  • 14
0
votes
1 answer

View taking the place/position of another view in custom adapter

I have a list of images that I'm showing, using universal image loader, now I'm trying to put an ad in between in position 4, but this ad is replacing the image in that position.. When looking at the positions and urls everything seems to be ok. Is…
0
votes
3 answers

Getting wrong position in custom ListView while scrolling

I am getting wrong position in custom ListView while scrolling. I have tried the ViewHolder pattern and an ArrayAdapter but both giving the same problem. If I reproduce the code using Java then I am getting the proper position while scrolling. So is…
0
votes
1 answer

Access data from another view inside anothers view setOnCheckedListener

I have a problem with my customadapter that extends simplecursoradapter. The problem is that inside a Listener for a view i want to acess data from another view. I could probaly use a checkedtextview but i dont think its looks good. public View…
0
votes
1 answer

what is difference between use of boolean array and class object with list in baseadapter class

i am using check-box with list view by extending base adapter class to "cust_listadapter"(custom adapter). in this when i am using boolean array to save selection of check-box then code is running fine, but when i used objects(beans) with Array…
Akashsingla19
  • 690
  • 2
  • 8
  • 18
0
votes
0 answers

Using SoftReference in ViewHolder pattern in android

I am new to this SoftReference and WeakReference stuff. I am making a generic ViewHolder pattern which keeps all views in Hashtable keyed by View's Id. I decided to use SoftReference for Hashtable and also SoftReference for value of item inside…
Rameez Usmani
  • 135
  • 1
  • 8
0
votes
1 answer

Toggle button resets on scroll listview

I have a code where the user is shown a list of items. A toggle button is placed alongside the list items. So when the user sets toggle on then an alarm is triggered. Now the problem is when I set the toggle button of 1st item in the list it…
Krish3090
  • 79
  • 2
  • 14
0
votes
1 answer

how can i set selected value from alert dialog (single selection) on my list view item?

How can i set selected value from alert dialog (single selection) on my list view item?... My scenario is: - I have listview item with button and textview - Clicking on button in my listview item , which opens dialog box - Selecting value from…