Questions tagged [android-adapter]

An Adapter object acts as a bridge between an AdapterView and the underlying data for that view.

An Adapter represents the connection between a View with some kind of data source. Adapters generally come in two flavours: those representing array/list based data and those that represent Cursor based data.

  • The Adapter provides access to the data items.
  • The Adapter is also responsible for making a View for each item in the data set.

See Adapter reference for more information.

Tag Usage:

3394 questions
0
votes
1 answer

Android recyclerview does not show any data

I'm using a template and I replaced the placeholder data with a Retrofit 2 request that parses a JSON file of the data from an URL and puts it into an object list. I ran into a problem where my retrofit call gets executed and returns items = 0 at…
0
votes
1 answer

Multiple RecyclerView(two) has lag - android

I have a list that load in RecyclerView with CardView and in CardView I have a RecyclerView that have (max) 10 items, I load it now, but it has lag: My First LessonContentListAdapter.kt: class LessonContentListAdapter :…
jo jo
  • 1,758
  • 3
  • 20
  • 34
0
votes
1 answer

RecyclerView Adapter not able to update

I am currently very stuck on a simple problem with a RecyclerView Adapter. The adapter takes a list of custom objects and displays them, which works as intended. But when I want to filter the list via a searchbar and apply the changes via…
0
votes
0 answers

How can limit the search in an adapter?

I have implemented an autocomplete adapter that works fine. I have found the code on this forum. This adapter lists customers and their associated code : Cust01 061213 Cust02 086554 oldCust01 654235 ... ... Cust12 876521 At the moment if I…
Mika
  • 5
  • 3
0
votes
1 answer

How to handle same code on two button Click Event

I am using a Recyclerview to show some question and answer. On click on arrow button doing some stuff and on click on tvTitle doing same stuff. Is there any way that I should not repeat the same code on two click listener. I can't use the method…
0
votes
2 answers

How to add section divider in Recycler-view

Scenario : I am trying to add the section between items in the recycler view. This divider is not with every element but it is based on the datasource. My Datasource has a divider property for that cell it means it is a divider cell and a divider of…
RATHI
  • 5,129
  • 8
  • 39
  • 48
0
votes
1 answer

How can I iterate through a gridView base adapter to check the text on it?

I have tried different ways, I've been stuck trying to do it for weeks. I also tried to add the code in the adapter, I thought about using sqlite, but I just can't figure how to do it. I just want to check a condition, if this string exists…
0
votes
1 answer

Recyclerview Not Scrolling Inside ViewPager

I have ViewPager2 with 3 Fragments and all has recyclerview but in Middle fragment recyclerview not scrolling if i try to touch recyclerview Items but it scroll smoothly if i touch right or left side of recycler as you can see in image. View Pager…
0
votes
0 answers

Is turning a mutableList into a new list for .submitList() too inefficient? - RecyclerView, ListAdapter

I'm using a ListAdapter for my recyclerView and because I'm working with a mutableList in my viewModel, my recyclerView UI does not update the list if I just pass the same mutableList updated. The simple solution is to type 'it.toList()', but I…
0
votes
1 answer

Creating a custom layout for horizontal buttons with wrapping

I wasn't sure what to title this without explaining it all there. Essentially, I want to populate part of a screen with a bunch of buttons. The buttons should have text from an ArrayList (or other structure) and they should be aligned horizontally…
0
votes
1 answer

How to show dialogFragment in Adapter onBindViewHolder using findNavController?

i have a problem. i want to show my EditFragment when item clicked, but it keep going to my EditFragment instead of showing Dialog this is the code override fun onBindViewHolder(holder: ViewHolder, position: Int) { val type = list[position] …
0
votes
1 answer

Get data from list of EditTexts in a recycler view to a list?

I am having an EditText in a TTextInputLayout as a Row_item for my recycler view, On the click of a button I am incrementing the count value in that recycler view and adding the edit text views in the app. After having as many views as I want, I am…
0
votes
2 answers

Make a ListView behaviour like a vertical Gallery

I have the following code that make the ListView appears like a Vertical Gallery public class VerticalGallery extends ListView { private View currentDisplayingView; private int currentPosition; public VerticalGallery(Context context,…
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
0
votes
0 answers

Try to import JSON image from placeholder. Got errors

I am new to Android kotlin and are currently making a app that import JSON from a url. I am trying to display a image with info like title etc. This error (look futher down) appear in Logcat when I tried to import image from…
0
votes
0 answers

RecyclerView elements dont show when using Linkedlist

I am using a recyclerview to show cardview elements, and have made an adapter for the same. When I use an Arraylist to store the values, the recyclerview works as expected and the elements show. Howver, I want to use a linked list as items are…
1 2 3
99
100