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 flavors: those that represent 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:

3159 questions
0
votes
0 answers

use executePendingBindings() with gridView

I am trying to use executePendingBinding with gridView adapter. On some data change the binding is not executing at first but other UI operations are being executed before that. How do I prevent that. Here is my ImageAdapter : class ImageAdapter…
0
votes
2 answers

Someone help me. I got this problem after recompile with API

Hello so this is my code, somehow i still get error down there i described error , any help would be appreciated, I am not really expert with import of this and especially emulator itself. import android.content.Context; import…
0
votes
1 answer

Recyclerview adapter onBindViewHolder payload is not working

I checked all the examples, but they don't work after all. As far as I know, even if payload is 'List', String or Int value can go into. class RecordListAdapter (val context: Context, val layoutManager: LinearLayoutManager, private val…
J.Dragon
  • 450
  • 4
  • 10
0
votes
1 answer

How to get values from editText and other fields from recyclerview adapter for a submit

What I am trying to do is making a submit process in which I go through every item comparing a field and an entry in a textview in the same item before submitting. I can not quite get how to get the values when I click the submit button. This is the…
jvargas
  • 526
  • 4
  • 10
0
votes
1 answer

How to Setup Spinner Into Recyclerview Adapter

I know this has been asked several times but I do not quite get it. I have an adapter and for every item, I need to set up a spinner. For context, I am working on a sort of product sales application. So the adapter is filled with products from the…
user12893803
0
votes
0 answers

How to refactor a big recyclerview adapter?

I have a very big recyclerView in my code with a lot of if statements in the onBindViewHolder: sometimes position 1 to 5 will have this view, sometimes they will have another view, and some other times, they will have another views. I have more than…
0
votes
1 answer

How to call a fragment method in adapter

I have a fragment holds a recyclerview and textview so i want to call a method which i declared in the fragment inside the recyclerview adapter because i have a plus button in each recyclerview item so when i click on it the method will being called…
0
votes
2 answers

How can I get the Adapter (or actually transfer data to the adapter)that's object is initiated in the other activity from the MainActivity?

I tried several ways but always get a NPE due to difference in lifecycles etc This is my MainActivity where I need to transfer a new Contact to the adapter public class MainActivity extends AppCompatActivity { private TextInputEditText…
user11199975
0
votes
2 answers

Room - SELECT doesn't return any data

Can't get where is my mistake - it seems data is inserted (I checked the database file through Device File Explorer) but it doesn't returns. I wonder whether it's in Adapter or ViewHolder or anywhere else. Any help is granted! This the activity…
user11199975
0
votes
2 answers

can't show image in my gridView by adding glide

I am trying to create a gridview with some cardview containing imageview, and I am setting the default image in the adapter getView method but it is not working. This is my gridView Adapter: class ImageAdapter constructor(private val mContext:…
0
votes
4 answers

Android Adapter only fetching the last entered data

I tried looking around but cant seem to find an answer that could resolve it. Here is the process of what I'm doing: 1: Users enter data in a alert dialog 2: Data get sent into sql. 3: Adapter runs, takes data and put into a cardview. 4: Cardview…
DevilArts
  • 3
  • 1
0
votes
1 answer

Iterate quantity for items , custom adapter

I have a listview where every items have one TextView and 2 Buttons ( + and - ). I want to iterate the quantity from TextView when I press the + Button. After this, I need to sum up all items (price * item quantity) for every item from the list and…
0
votes
2 answers

Correct context to use in RecyclerView adapter

Which context should I be using when I use a SharedPreference within a RecyclerView adapter? This is confusing as when during the default one, context in val mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) appears as an…
0
votes
0 answers

AutoCompleteTextView set width to longest adapter item

I have an AutoCompleteTextView (as part of an Exposed Dropdownmenu). I don't want to set a fixed width to it, instead the width shall be determined by the widest item from the adapter. So I've set the width to wrap_content, but this changes every…
stefan.at.wpf
  • 13,061
  • 31
  • 116
  • 199
0
votes
3 answers

How can I add data from one of my fragments, and pass it to my adapter, and set it to my array list?

I tried implementing animalAdapter.addNewAnimal(animal) but my App crashes with this error: Process: com.example.navigationcomponentexercise, PID: 15974 java.lang.UnsupportedOperationException at…
1 2 3
99
100