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

Textview data is not being updated when called inside from function in ListView Adapter

Textview data is not being updated when called inside from function in ListView Adapter. Please help in setting binding.tvQ.text class CustomPizzaListAdapter (private val context: Context, private val pizzaItemList: ArrayList) :…
0
votes
1 answer

How to navigate to 2 different fragments using same adapter according to the type of model?

I want to navigate 2 different fragments using same adapter according to the type of my model. But my problem is I can't handle onItemClicked with two different models. As you can see: private val onItemClicked: (WordsWithMeanings) ->…
0
votes
2 answers

Change the color of the Recycler view item and return to the original state in kotlin

I have a Recycler view to display a custom calendar and everything works fine My problem is: when I click on one item, the color of the item changes, but when I click on another item, the previous item does not return to default. my code : class…
0
votes
0 answers

Setting different height to every item according to video causing lag in recyclerview

I have a recycler view with a frame layout and I'm adding video player to it in onBindview holder. MY NEED: If the video height is smaller than 4:5 ratio then warp the height of frame layout according to the video height. If the video height is…
0
votes
2 answers

ListView show blank space instead of local image

i'´m trying to load a list with just a local images and texts, everything works fine, i mean i can see the text fine but in the image field i can´t see the image. the local images routes are "/mnt/sdcard/Imagenes/pic1.jpg/",…
0
votes
0 answers

RecyclerView.Adapter doesn't update size of a list after filtering

What I would want to do: I would want to filter through list and show values that match the search phrase. Additionally I would want to show correct current list size in the UI. What is the issue: The issue is that I can filter through list, but on…
Cuyer
  • 95
  • 8
0
votes
0 answers

how to add large no views in linear layout insde base adapter?

`> In base adapter add views in linearlayout small no of views correctly added but large no of views (above 200) that scenario following warning come in logcat an also app showing popup like "app not responing". Anyone help me how to solve this…
0
votes
2 answers

RecyclerView crashes when I update data to Firestore

I'm showing data from a Firebase Firestore collection, the app worked fine while but when I update data to the collection from other device (I got an Arduino with sensors connected to a PC that executes a Python script to transform the serial data…
0
votes
1 answer

Kotlin-Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setAdapter(androidx.recyclerview.widget.RecyclerView$Adapter)'

I Am trying to run the application but it crashes when i try to access the content of a bottom navigation bar which has a fragment in it and the fragement cointains a recyclerView.The adpater is null here is the error java.lang.NullPointerException:…
0
votes
1 answer

Databinding in recyclerView item doesn't work with the fragment viewModel

I have a recyclerView that shows a list of cart items, Every item is clickable and opens details fragment for that item, I'm Updating the item layout to have a delete button inside, the delete button suppose to call a method inside the fragment…
0
votes
1 answer

How to set layout of any other item in RecyclerView invisible/gone when click current item

i need help. I wanted to change button visibility in any other item inside recyclerview to dissapear, so other button except item that i selected become invisible ... The trigger is when item get clicked/selected then any other item's button goes…
0
votes
0 answers

How to delete an item in adapter on RecyclerView? (Xamarin Android C#)

I am currently following a video wherein an he created a deleteclick event in the adapter to delete a certain item. What is the right syntax in only deleting the item in adapter without deleting it from the firebase? This is the adapter click…
0
votes
1 answer

Is it possible to use DIffUtil/AsyncListDiffer with other Collection than List?

I'm currently using DiffUtil/AsyncListDiffer with a List collection. I'm using the general adapter/recyclerview/ViewHolder implementation. Items are a List. Can I use a LinkedHashSet instead of a List? Also, if yes, is it a major change?
0
votes
1 answer

Getting W/RecyclerView: No adapter attached; skipping layout

I have been sitting with this error for so long. I tried almost every solution available on the internet. Most of the solutions were asking to try different versions of these lines. I am still getting the same error. val recyclerview =…
0
votes
1 answer

Why recycler view only show first data only?

So I have 3 data on my firestore database, but when I run my app, it only show the first data only. I thought the binder will automatically read all the data and increase by itself like a loop. But turns out it stucks to only first index position. I…