Questions tagged [android-adapter]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

position doesn't work depends on getItemCount in RecyclerView (Kotlin)

override fun getItemCount(): Int { return ekipListesi.size } override fun onBindViewHolder(holder: KisilerVH, position: Int) { holder.binding.kisiAdiTextView.text = ekipListesi[position] println(...
drSefa's user avatar
  • 1
0 votes
0 answers
12 views

Why android Recyclerview automatically update without adapter notifyDataSetChanged() method called? when data is coming from web socket background

I am showing list of data by recyclerview. so when data is comming from web socket then adding new items in existing list so my recyclerview update automatically. i am not explicitly calling ...
Deepak Parmar's user avatar
0 votes
2 answers
39 views

MVVM- check updates with Recyclerview adapter

I am having hard times understanding updating my recyclerView- Adapter items with a Live-Data<List<SomeObject>>. Let's say I have a RecyclerViewAdapter in my Fragment which I initialize ...
Sasuke's user avatar
  • 33
0 votes
0 answers
11 views

Items of RecyclerView isn't change when I notify it up

I just want to know what is the perfect way to notify data changed as I change data of RecyclerView.I am changing the whole list of recyclerView and want to inform about it. fun filterData(...
Arifmmmdov's user avatar
0 votes
2 answers
25 views

Why are all the images not coming to first column and the textviews two second column in android?

So, i have a list of images and another list of names of those images. I want to display all the images one below other in cardviews of first column and all the names one below other on cardviews in ...
PurpleRabbit's user avatar
0 votes
2 answers
42 views

How to correctly pass a list to Adapter from the Retrofit Response? [Android Studio 2023]

So, I have followed many YouTube tutorials to correctly learn about Retrofit in Android and how to pass data from the response to my adapter and display the list but none of them is working for me ...
Dhruv194's user avatar
0 votes
0 answers
19 views

Android - Difference between a Custom Adapter vs Default Adapter layout for AutoCompleteTextView element

So I am not entirely sure why this is occurring: Below I'm using the default android.R.layout.simple_list_item_1 layout and the code works like a charm, where the OnItemClickListener working as ...
Learn2Code's user avatar
  • 2,004
0 votes
0 answers
11 views

How to count "selected" items in RecyclerView, bases on checkbox status

I have a RecyclerView with a checkbox component, underneath there is a list of POJO with "isSelected" attribute. Everything work fine when no items are selected at startup. But in some ...
Nicolas400's user avatar
0 votes
0 answers
17 views

Error in fetching data using FirestoreRecyclerAdapter in recyclerview crashing app

im developing a Rent car app uising firestore database when i use simple adapter it fetch data correctly from firestore but when i use FirestoreRecyclerAdapter the app crashes. I badly need to use the ...
Tayyba Rani's user avatar
-2 votes
2 answers
36 views

How to show distance between two locations in recyclerview items?

I have two classes User and School as follow: User: name, age, latitude, longitude School: name, latitude, longitude, level, address, rating And I have an adapter for lists of schools that comes from ...
user21193451's user avatar
0 votes
0 answers
11 views

Why are URLs not getting linkified when enclosed in Html.fromHTML() in my Android app?

I have the following code executed in onBindViewHolder() of a RecyclerView: String commentPrompt = "<html><b>" + ((ViewHolder) viewHolder).comment.getText().toString() + &...
FractalBob's user avatar
  • 3,255
0 votes
0 answers
27 views

How to group items within RecyclerView when using FlexboxLayoutManager

I am making a simple quiz-like app where the player needs to guess a set of words based on some clues. The placeholder for the words is managed using a RecyclerView where each item corresponds to one ...
BuddhaBowl's user avatar
0 votes
0 answers
47 views

Kotlin gridView is not displayed in fragment

i would like to use a grind view in a fragment but i couldn't find how to do it. so i tried to adapte the way i did it in an activity but even if i don't get a crash, the grid is not displayed. Here ...
XCarb's user avatar
  • 765
0 votes
0 answers
29 views

Why do i lose values ​after scrolling in Recycler View?

Whenever I add multiple items, for example more than 7 and that's scroll to the top. The top items are lost. When I go back down the bottom items are also lost After entering the data, if i scroll ...
mohinuddeen's user avatar
0 votes
0 answers
30 views

How to make checkbox selection in a dialog with RecyclerView affect only the current row in the parent RecyclerView?

I have a parent recycler view with multiple items and two buttons for each view. If I click the button that I have highlighted, a dialog with another recycler view pops up which has checkboxes ...
Deepjyoty nath's user avatar
0 votes
0 answers
66 views

How to create one horizontal and one vertical RecyclerView with headings in a parent RecyclerView using Kotlin?

I am currently using one recycler view which is Parent and vertical scrolls in home fragment, I search through resources but as learner I cant find anything useful, I WANT TWO RECYCLERS_VIEW WITH ...
Akhil Bhatnagar's user avatar
0 votes
1 answer
117 views

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 occuring in my Activity's Adapter

When I started the MainActivity, my app crashed and returns the error : java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 on my stack trace. Here's my adapter code: class MainAdapter: ...
Bryant Anthony's user avatar
-1 votes
1 answer
25 views

Delete an view from the MainActivity

I have a recycler view app in which it takes data from user and set it on a recycler view I want that when user will click on that view an alert dialog box will open and it will ask that should he ...
Sumita Das's user avatar
0 votes
1 answer
24 views

RecyclerView isn't displaying any items

My recyclerView isn't displaying any items. I'm not getting any errors though so I'm not sure what the problem is. Here is the code. MainActivity.java package com.example.recyclerviewexample; import ...
Lux's user avatar
  • 15
0 votes
1 answer
45 views

Can someone tell me why it gives me an error when I try to use "absoluteAdapterPosition" in a Recycler View in Kotlin?

It tells me there is a mismatch, it requires "AdapterView<*>! but it has found "Int". How do I fix this? class InstructorViewHolder(itemView: View, listener: OnItemClickListener) ...
Mosfeq Hossain's user avatar
1 vote
1 answer
21 views

Getting this error - java.lang.llegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line1 column 2 path $

I've also tried to do this api calling by using DiffUtil but the error remains the same and i keep getting this error java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at ...
Aditya Kumar's user avatar
-1 votes
1 answer
36 views

My app is Crash when i'm Selecting the song, how to solve this

This is my music adapter file and this is logcat error at com.example.apna_music.MusicListAdapter$1.onClick(MusicListAdapter.java:57) at android.view.View.performClick(View.java:7570) at android.view....
Satyam Jha's user avatar
0 votes
2 answers
52 views

Andriod - RecyclerView not printing items as expected

I have a bug RecyclerView where items are not coming as expected. RecyclerView is using multiple ViewType (Category and items) but Currently, The adapter is printing items like this. (The Category &...
GeekWithGlasses's user avatar
0 votes
2 answers
266 views

RecyclerView with CheckBox does not keep selected items

I have a list with RecyclerView + Adapter + ViewHolder and each item list contains a description and a CheckBox. If I select an item and scroll down the list RecyclerView does not keep the selection ...
Anderson Gabriel Ferreira's user avatar
0 votes
1 answer
39 views

Is there a way I can setAdapter and setMessage at the same time for MaterialAlertDialogBuilder?

I want body text to appear above a list of views inside dialog from MaterialAlertDialogBuilder. I tried setting body text and adapter but it only resulted in showing the body text, ex1. ...
haru_bleu's user avatar
0 votes
0 answers
37 views

How to know recyclerview visible items which exist another recyclerview? (Nested recyclerview impression)

I have recyclerview. This recyclerview has view holder which has another recyclerview. Both recyclerview orientation is vertical. What I'd like to do is listen child recyclerview impression event. In ...
Enes Zor's user avatar
  • 993
0 votes
1 answer
80 views

How to show Interstitial ad after 3rd post in Android Studio?

i am making app with Android Studio using Wordpress as backend and fetching posts via json api .. now i want to implements AdMob interstitial ads in my app but don’t want to show ads for every post ...
noorapps's user avatar
0 votes
0 answers
22 views

Unable to populate listview fragment from array of string

I am unsure where I am going wrong. I have used an array before to populate a listview and had no issues. Now that I am using a fragment I receive errors that I am unable to fix. I log to find where ...
deeko's user avatar
  • 5
0 votes
0 answers
17 views

RecyclerView content disapears on device rotation

Im doing an activity to show a profile that contains some cards with sports related to it, the idea is to see three cards at a time and be able to scroll the cards to see the next ones. This is the ...
Juan José Jaramillo's user avatar
0 votes
0 answers
28 views

Variable 'singleChoiceAdapter' is accessed from within inner class, needs to be final or effectively final

I created a function with name setRecyclerViewSingleItems so that i can restrict the user to select only one option from the given options ( those options are stored in arrrayList ). I want to create ...
Akshat Agrawal's user avatar
0 votes
1 answer
31 views

Get the Margin top of a clicked item in a listview

I have a problem with the setSelection of a Listview that I fill with Adapter. I use setSelection when I return to a list of items, after I have clicked on an item to see the detail (view2)or edit its ...
Kevin's user avatar
  • 405
0 votes
1 answer
70 views

How to calculate how many items fit(visible) in screen at recyclerview?

I have a simple recycler view and their adapter my question is that how to calculate how many items fit(visible) in screen at recycler view? for example if my data list size is 30 and visible item in ...
Mehrzad's user avatar
  • 93
0 votes
0 answers
21 views

Changing the value of one EditText in ListView changes other EditText values in ListView

What I want to do is that when editing any EditText in the ListView, the values in all EditTexts change. For example, the user clicks on EditText2, enters the amount 100, the amount is multiplied by ...
Denis Stifler's user avatar
0 votes
0 answers
27 views

I want to access an imageview that is in another fragment/layout from my adapter but can't get it done

I am trying to access an imageview from my adapter. I currently have implemented a layout into it but i need to access a diffrent fragment from here aswell. My adapter code is here and the imageview ...
KeremE.'s user avatar
  • 13
0 votes
1 answer
151 views

How to navigate to another fragment using Navcontroller after clicking on cardview?

I have various Cardviews and I want to go to specific fragments of each after I click on them. I am using Navigation graph and i want to use NavController for going to another fragment. I am trying to ...
PurpleRabbit's user avatar
1 vote
1 answer
267 views

How to fill a Spinner from my code in Java (Android Studio)

I'm making an example with Android Studio and I want to add items to a List that is displayed in a Spinner. Looking here, I found this answer that helped me a lot. Basically I create an ArrayAdapter ...
Tony Valderrama's user avatar
0 votes
2 answers
118 views

Unable To Attach Views from XML Layout in RecyclerView

I am unable to attach the views from my xml file in onBindViewHolder of Recycler View in my Adapter. I'm getting the following error: Unresolved reference: ivArticleImage I am using DiffUtil Class. ...
kathy minikova's user avatar
0 votes
1 answer
53 views

Android RecyclerView.Adapter not updating

I've got My RecycletView.Adapter which has a field of Type ArrayList to set my Holder (inner class). If I try to update my Adapter from the Adapter class itself (OtherAdapter in my example) by setting ...
Dario Franzese's user avatar
0 votes
1 answer
22 views

Is There any Way to Open Another Fragment From OnClick on Recycler View

When I Click On Photo To execute On Click Event of Recycler View to Open Another Fragment I get This Error java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android....
Amaankhan Pathan's user avatar
0 votes
2 answers
61 views

Recylerview blank when using ViewModel in fragment

Here, the flow first in a screen there are three buttons which are also created using recycler view. View Model is passing the data to fill the button content ie image and text. This is working fine. ...
Joji's user avatar
  • 21
0 votes
2 answers
71 views

How to update previous Items in Android Recycler view?

I have a RecyclerView to list a set of data. And on clicking each item , I have validation to check previous item is entered or not. If that item is not entered I want to enable an inline error (which ...
Malhotra's user avatar
  • 231
0 votes
1 answer
183 views

How to use Nested RecyclerView in ListAdapter<T, VH>

I am working with Nested recyclerView, which mean a RecylerView's item also has a RecyclerView in it. I know basic approach using RecyclerView.Adapter but I want to achieve this using ListAdapter. Is ...
Abhishek Charismatic's user avatar
0 votes
0 answers
26 views

Can't update Item from RecycleView using a Custom Adapter and Listener

I have an updateTask method which opens an alert dialog. I am trying to call this method through a listener in the onBindViewHolder function in my custom adapter. However my alert dialog does not pop ...
Simonstre's user avatar
0 votes
1 answer
54 views

Can't update my recyclerView with view model in room database, every item edits the previous one, not its item id in recyclerView

When i tried to update my recyclerView with view model in room database every id edits the previous one, not its item id in recyclerView. I used adapterposition for passing the data from recyclerView ...
user avatar
0 votes
2 answers
54 views

NotifyDataSet Changed Android - Recycler View Adapter

val recyclerView = findViewById<RecyclerView>(R.id.rv) val adapter = UserDetailsAdapter(users) recyclerView.adapter =adapter recyclerView.layoutManager= LinearLayoutManager(this) ...
Jithin Murali's user avatar
0 votes
1 answer
78 views

How to change number of item count in Adapter?

i am making app with Android Studio using Rest Api from my WordPress website , i have done all and its working , now i have implemented adMob ads between post and it also works but the problem is when ...
noorapps's user avatar
0 votes
0 answers
12 views

Adapter Not showing all posts in RecyclerView

i am making app with Android Studio and fetching data in rest api using my Wordpress Website , i can see posts but the problem is it doesn’t display the very last 2 posts, when i log title in retrofit ...
noorapps's user avatar
0 votes
0 answers
257 views

java.lang.ArrayIndexOutOfBoundsException: length=22; index=-1

i am very new to Android Studio and making app with my WordPress website and using Rest Api to fetch data from my website , all works fine and i have added sort posts menu in my app and users can sort ...
noorapps's user avatar
1 vote
0 answers
39 views

I want convert a listview to a recyclerview

I want to convert a list view to a recycler view. want to separate line adapter from user adapter. if possible how to do it, and please give sample code mainActivity public static class ...
Alhe Mora's user avatar
0 votes
0 answers
16 views

How to show ProgressBar after AdMob ads in Adapter?

i am making android app using Rest Api and date getting from my WordPress Website , all works fine , i have added AdMob ads between content and when its loading page 2 from page 1 there is ProgressBar ...
noorapps's user avatar

1
2 3 4 5
68