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

ListView item not deleting/copying correctly even with view holder

My listview isn't updating correctly when I try to remove or copy an item. The data is storing correctly in the database, but is not displayed correctly on the listview, which I think is due to issues with recycling views. For example, I deleted an…
-1
votes
3 answers

android - ViewHolder single onClick affects multiple list items

I am using a Custom List Adapter with ViewHolder pattern to inflate views into my List that shows an image (width = match_parent), some text on the left (below the image) and a button on the right(also below the image). Here is the code for the…
Kunal Chawla
  • 1,236
  • 2
  • 11
  • 24
-1
votes
1 answer

Holder returning wrong values

In my getView method when I am trying click an imagebutton of a view,Imagebutton of its adjacent view is being clicked and same for the other UI's,which means it is returning wrong view each time.I am not able to figure out where the problem…
Nidhi
  • 777
  • 7
  • 17
-1
votes
1 answer

replace fragment on button click of viewholder

I wanna replace fragment on button click in viewholder. viewholder static class ViewHolder { Button button; TextView title; } Adapter class of FragmentA that consists listview viewHolder.button.setOnClickListener(new View.OnClickListener() { …
-1
votes
1 answer

Issue with ViewHolder selection

I am working in an app in which I handle a ListView which is composite with ViewHolder. In this ViewHolder, I have a CheckBox. Here is my code: private class SettingsArrayAdapter extends ArrayAdapter { Context context; …
-1
votes
1 answer

ListView values disappear

I'm using SimpleAdapter to populate ListView and every row has two buttons TextView and RadioGroup buttons. As you can see in the code when I click button A, I set button A to be highlighted, set TextView to 1 and set text radio button A to 1 and…
forel
  • 33
  • 6
-1
votes
2 answers

ViewHolder Listview - Custom Adapter

I've been reading up on Viewholders for listview and the benefits are such that they can help improve the performance of the listview scrolling.I've been trying to implement it for my CustomAdapter but it seems that I'm doing it wrong…
-2
votes
3 answers

Android App crashing due to RecyclerView?

My main activity file package com.example.custom_listapp; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.os.Bundle; import…
-2
votes
1 answer

Understanding the functionallity of onCreateViewHolder()

So I implemented this method based on a tutorial : override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TestAdapterHodl { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_card, parent,false) …
Pixelherz
  • 21
  • 3
-2
votes
3 answers

What is the function of an inner class in Kotlin and Android

Please i would like a detailed explanation on what an inner class does what happens in this specific instance. If i dont type out the inner in an inner class of recycleview. calling notifyDataSetChanged() throws an error like this But if i type…
-2
votes
1 answer

How to bind switchButton in itemView to respective object in RecyclerView?

I am beginner, I'm trying to figure out. I have objects Word (String swedish, String russian, int status). Status defines in which gamelevel the word should appear (for now it can be 200 or 300). How can I do so that switchButton "switchStatus" in…
-2
votes
1 answer

what is the difference between extends Recyclerview.Adapter vs RecyclerView.Adapter in RecyclerView

I have been reading online about RecyclerView in Android. As a beginner, I have seen some online tutorials extend RecyclerView.Adapter and some RecylerView.Adapter only. Actually, what is the difference…
Athira Reddy
  • 1,004
  • 14
  • 18
-2
votes
2 answers

I am trying to display data from server to Recycler View but getting error

I have made a recyclerview and populating it with data from server with volley, but this error keep coming back, I have tried all the solutions available but it won't work. Some help will be really appreciated. I am using MySQL database my api for…
-2
votes
2 answers

How to Update the Views of the RecyclerView - without Passing a Copy of the Data

I want to update the views of my RecyclerView view every 30 seconds. I use the this statement: adapter.notifyItemRangeChanged(0, channelsInGroup.size()); and it does not work. I could get it working by copying the contents to a new arraylist,…
burakk
  • 1,231
  • 2
  • 22
  • 45
-2
votes
1 answer

Context - null object reference

I have Fragment with RecyclerView adapter. Also i have month array and icluded posts array object. I try to add posts table rows dinamically. I dont know how it should made. public class NewsAdapter extends…
AlexS
  • 918
  • 1
  • 12
  • 28
1 2 3
70
71