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

Wrong item removed from RecyclerView

My RecyclerView receives data from phpMyAdmin, I added a code to the Adapter so that I can delete element, but when I click on the button, the element is delete on one position higher, that is, I click delete element 5 and element 6 is deleted, how…
0
votes
0 answers

Handle RecyclerView adapter position inside a delayed listener

How should we handle the adapter position inside a delayed(probably) listener callback of Glide when the size of the list is changed before the ballcack is received? Error: Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3 I have…
0
votes
0 answers

Custom ListView with CustomAdapter Not Showing Up

I am creating fragments inside Android Studio where one of my fragments calls an API and displays the listview with a custom listadapter. However, I have read many similar examples but none can determine why my listview is not appearing. This is my…
0
votes
0 answers

LinearLayout problem, Pagination recyclerview with DiffUtil & AsyncListDiffer not working

Basically My problem is not with DiffUtil & AsyncListDiffer but the issue is in the LayoutManager item count. Please look at my code: recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public…
0
votes
0 answers

RecyclerView Displays a Single Item When a user logs in

The recyclerView shows a single item when an authenticated user logs in. The authenticated user has to see different photos i.e if they have uploaded different photos. The MainActivity gets data from firestore and is stored in an array list which is…
0
votes
1 answer

How can i get image url from firestore after set in baseadapter?

Hello i want get by image from firestorage so I make custom adapter do my so I write this code and surf internet and read books but i can't get information... need help package com.example.lazywarriorsapp; import android.content.Context; import…
0
votes
0 answers

onBindViewHolder inside FirestoreRecyclerAdapter only works in Debug mode

I have a list of students shown on a RecyclerView and retrieving data from Firebase I want to check a checkbox if they are inside a group. It apparently works, but only in Debug mode. Whenever I try to do a normal run it does nothing (only shows the…
0
votes
1 answer

Unresolved reference: adapter in RecyclerviewFragment

I'm currently trying to implement editing items in Recyclerview on imageView click in a single Recyclerview row, but I can't figure out how to solve the reference for adapter outside of onCreateView in a fragment. How do I fix this issue and get rid…
Juncu
  • 3,704
  • 4
  • 7
  • 27
0
votes
1 answer

update one particukar item in recyclerview from fragment after success response android kotlin

Fragment Recyclerview code : private fun initRecyclerView() { bestSellersAdapter = BestSellerProductsAdapter(frag) homeBinding.popularproductsRView.apply { bestSellersAdapter.second(this@HomeFragment) adapter =…
0
votes
0 answers

Why is updating list of items in RecyclerView not working?

I have an AddMedication activity which adds a new item to a database and returns to a main screen fragment which contains a RecyclerView list of items. The problem is that the list doesn't get updated with the newly added item. I have tried…
Jan Horčička
  • 671
  • 1
  • 11
  • 26
0
votes
0 answers

Where to destroy View Binding for Recycler View's Adapter in Android?

I am trying to add View Binding in my RecyclerView's adapter like this:- class MyAdapter(private val myList: List) : RecyclerView.Adapter() { private var _binding: MyItemBinding? = null private val binding get() =…
0
votes
0 answers

Android Kotlin - How to filter Concat adapters?

I have had no problem setting up filters for individual and nested recyclerview adapters. However when it comes to filtering a Concat adpter I'm lost when it comes to implementing it. One of my solutions results in unpredictable crashes when I try…
0
votes
0 answers

How not updated listview and viewpager on scroll?

When i click button, scroll listview my button always set button visibility undo. In viewpager when i scroll views with videos they always reset loading video. How i can disable this? code adapter listview: public View getView(int position, View…
0
votes
1 answer

Why List view is not getting printed in the Activity?

I have created and Application where I used SQLite UserDB database and I have Successfully inserted data in the User table now i need to print that Data in the Second Activity thus i am calling intent on my first page and using onclick listener I am…
0
votes
1 answer

Change Background color of recyclerview items while selecting and deselecting

I am able to change the background color but my main issue is that it is changing the Background color only for alternate Recyclerview items(Not for each and every item.) eg:(changing color of 1st,3rd & 5th item but not for 2nd and 4th ) Below is my…