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

Query re RecyclerView for YouTube Channel & using YouTube API (Android)

I'm after some assistance please if anybody could help. I've followed a guide (funnily enough on YouTube!) concerning how to register for an API Key for YouTube, create a RecyclerView on an App and then parse info off of a YouTube Channel using JSON…
0
votes
1 answer

Comunication between a running android service and a recyclerview adapter inside the same service

So I have a foreground service displaying a few items, I want to perform some function in the enclosing service when I press on an item in the recycler view. I'm aware I can use an Instance of the service, but it's a memory leak. I'm aware as well…
0
votes
1 answer

Kotlin app crash when list refreshed on click

I've made an Android app that use a custom listview with an adapter, a refresh button and an onlick event for each row. My problem is that the first time that the list load all works well, but when i hit refresh then i click on a random row the app…
0
votes
1 answer

View the adapter starting from a certain position

I have a RecyclerView displaying a list of images & and when a user clicks on one of the images e.g position 2, it takes them to a ViewPager with that same position & they can horizontally swipe to view other images from there. The issue I am having…
Boron
  • 99
  • 10
  • 34
0
votes
0 answers

ViewPager2 how to restore fragments when navigating back

Hi folks I have a ViewPager2 with single activity architecture. When I click a button, I swap out the ViewPager2 host fragment with another one using the Jetpack Navigation library. This calls onDestroyView for the host fragment. When I click back,…
0
votes
1 answer

Why is my adapter is not changing the value of TextView when I update the firestore database?

Model Class (Data Class) data class Message(var userID:String? = "",var message:String? = "",var recID:String? = "",var isSeen:String="") I have an an adapter that is supposed to change the value in a particular TextView based on the value of the…
0
votes
0 answers

How to visible full item when click on item in reyclerview android

Hey I am working in android. I have list in horizontal form. I want to do, If my view is half visible in device and if clicked, then me recylerview scroll that item, i.e. it will visible it fully. So How Can I do in my recyclerview. Can someone…
0
votes
1 answer

How to send a variable to an Adapter to send it through an Intent to another activity?

I have an adapter for my RecyclerView where I program that when I click on the element (of my RecyclerView) it executes an Intent with a putExtra to take me to another activity, the variable that contains my putExtra comes from the element that I…
0
votes
1 answer

Change RecyclerView Row When Observe User

I am building a chat app with Firebase and MVVM. I built a feature to show if the user is online or offline. I observe the app lifeCycle and updating the value in the user real time database under the key: "status". So I have a recyclerview that…
0
votes
1 answer

Cannot infer arguments (unable to resolve constructor)

I am trying to make a program with a tablayout, each tab representing a fragment. In the second fragment (AddFragment), im want to make a list that displays the strings I entered in the EditText. But its giving me the error above. More…
jakob
  • 1
  • 2
0
votes
1 answer

Android: changing cardView visibility in recyclerView

I have a recyclerView containing items presented by 2 Cardviews in the same Layout. When I click on a Cardview, I want the other cardview to collapse or expand. It works but when for example I click on card 1, card 9,18,... also expands. I have read…
Mat777
  • 328
  • 1
  • 4
  • 10
0
votes
1 answer

Adapter of recycler view causes crash and forces stop

When I use a recycler view and adapter, the adapter doesn't let the app to install and it causes a crash. I commented out the adapter in my main activity and it started successfully but with adapter it doesn't work. My adapter class is here: public…
0
votes
1 answer

Change Spinner's getAdapter() and setAdapter() method

This question seems obvious, but I can't figure it out. I have a custom LanguageSpinner class: class LanguageSpinner(context: Context, attrs: AttributeSet) : AppCompatSpinner(context, attrs) { override fun getSelectedItem(): LanguageSpinnerItem…
Corec
  • 91
  • 2
  • 9
0
votes
1 answer

Kotlin Gridview display issue on click and Scroll

I am having a gridview which is populated from a list of string. List of string is a simple array of alphabets. Here is my Activity Xml
Gulfam
  • 558
  • 6
  • 27
0
votes
1 answer

how to create secondary constructor in recycler adapter taking arraylist parameter in kotlin android studio

enter image description here I AM trying to create other constructor in recyclerView adapter but getting error please tell me how to create secondary constructor in recycler adapter taking arraylist parameter in kotlin android studio class…
1 2 3
99
100