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

How to get _id field from table and put it into ListView

I'm beeing bit confused here. SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.bugs_list_item, itemCursor, new String[] {db.KEY_ROWID, db.BUGS_DATE, db.BUGS_DESCRIPTION}, new int[] {R.id.bug_id,…
Jacek Kwiecień
  • 12,397
  • 20
  • 85
  • 157
0
votes
2 answers

How to assign item ids to Spinner's adapter in Android?

I need to map certain type identifiers to my Spinner's adapter. I have defined the type identifiers as constants: public static int TYPE_SOMETYPE = 0; // etc.. Now, how could I find out what type was selected in the spinner? What sort of…
Gerstmann
  • 5,368
  • 6
  • 37
  • 57
0
votes
1 answer

gridview load remote image . updating view?

I am using a GridView having image as child items. The getView functions loads a default image from the application "Loading.gif" for all the child items. In another thread I load all the images to some Bitmap type into the adapter. Is it wise…
Gaurav Shah
  • 5,223
  • 7
  • 43
  • 71
0
votes
1 answer

SectionedAdapter passing more then one string

in the adapter I have something like this protected View getHeaderView(String caption, int index, View convertView, ViewGroup parent) { and in the caption variable I have one string. This string is passed along the…
Lukap
  • 31,523
  • 64
  • 157
  • 244
0
votes
2 answers

How to append an id to a ListViewItem using SimpleCursorAdapter and SQLiteDatabase

I've been searching on this for a while now, but I can't find anything that could help me solve my problem. I have a list of categories in a listview. I fetch these from a SQLiteDatabase and use a SimpleCursorAdapter to put them in the list. This…
Diëgo
  • 103
  • 1
  • 9
0
votes
2 answers

MVVM- check updates with Recyclerview adapter

I am having hard times understanding updating my recyclerView- Adapter items with a Live-Data>. Let's say I have a RecyclerViewAdapter in my Fragment which I initialize with an empty list inside. When my Live-Data is loaded…
Sasuke
  • 33
  • 4
0
votes
0 answers

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(filteredList:List){ contactList…
0
votes
2 answers

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 second column. But I am getting the like this So,…
0
votes
2 answers

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 right now and I don't know why. In my MainActivity I…
0
votes
0 answers

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 desired. playerAliasAdapter = new…
Learn2Code
  • 1,974
  • 5
  • 24
  • 46
0
votes
0 answers

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 conditions, I will need to show the list with the checkbox…
Nicolas400
  • 563
  • 1
  • 7
  • 29
0
votes
0 answers

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 FirestoreRecyclerAdapter because i want to get…
0
votes
0 answers

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 = "" + ((ViewHolder) viewHolder).comment.getText().toString() + ""; TextView commentText = new TextView(context); …
0
votes
0 answers

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 letter of the hidden words. I am using…
0
votes
0 answers

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 is my code : Fragment class DashboardFragment :…
XCarb
  • 735
  • 10
  • 31