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

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 screen is 10 how can calculate number 10 (before…
0
votes
0 answers

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 10 and displayed immediately in all other…
0
votes
0 answers

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 im trying to access is declared like this val…
KeremE.
  • 13
  • 4
0
votes
1 answer

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 use Navigation but I am simply missing…
0
votes
2 answers

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. I Can access them by Binding method but by normal…
0
votes
1 answer

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 the ArrayList and notifyDataSetChanged() it…
0
votes
1 answer

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.os.Bundle.getString(java.lang.String)' on a null…
0
votes
2 answers

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. On click of button a new screen/fragment loads…
0
votes
2 answers

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 is hidden in normal case) message in the…
0
votes
1 answer

How to use Nested RecyclerView in ListAdapter

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 it even possible to get this with ListAdapter? My…
0
votes
0 answers

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 up and while debugging I found out that my update…
0
votes
1 answer

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 item in (EditCartFragment) to…
user11744085
0
votes
2 answers

NotifyDataSet Changed Android - Recycler View Adapter

val recyclerView = findViewById(R.id.rv) val adapter = UserDetailsAdapter(users) recyclerView.adapter =adapter recyclerView.layoutManager= LinearLayoutManager(this) Thread{ …
0
votes
1 answer

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 ad shows then the very last post is missing from…
noorapps
  • 39
  • 1
  • 6
0
votes
0 answers

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 response in MainActivity i can see all posts,…