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
1
vote
0 answers

When is implementing an android.widget.Adapter better than extending an android.widget.BaseAdapter?

I'm wondering when it's more appropriate to implement an android.widget.Adapter or android.widget.ListAdapter, rather than extend an android.widget.BaseAdapter. To put some context into it, I have a list that consists of different sub-classes of a…
cesar
  • 8,944
  • 12
  • 46
  • 59
1
vote
2 answers

Why does GridView need a BaseAdapter?

Why do we need BaseAdapter in GridView? Why base adapter itself? Can we use some other adapter type? public class ImageButtonAdapter extends BaseAdapter { }
elsa
  • 396
  • 1
  • 13
1
vote
2 answers

CheckBox checked automatically in ListView when scrolling the list

I'm using a ListView in my app which contains some elements like textboxes and CheckBox in each list item. When I fill the first textbox the seventh one or any other random textbox automatically filled with the same value and same happens with…
Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
1
vote
1 answer

Making cwac-merge adapters disabled

I found few days ago, amazing project, called https://github.com/commonsguy/cwac-merge. I want to make some adapter disabled (non clickable, like headers). On readme I can read: You can also extend MergeAdapter to override isEnabled(), so you can …
1
vote
0 answers

Android Cursor Adapter layout issue.?

In my application I am using Adapter. I struck at here . Actually I required to display xml/filename.xml into as below. I want to display like below code. I already done this manually but is there any method like we call layout. xml >layout>…
NovusMobile
  • 1,813
  • 2
  • 21
  • 48
0
votes
1 answer

Gallery and baseAdapter incrementation android

So, i like many have been battling to create a gallery that has two rows for android.. so far my solution is to have a base adapter call lay out that has two table rows with a spot for a photo in each, and then in my base adapter place one image…
erik
  • 4,946
  • 13
  • 70
  • 120
0
votes
1 answer

Using multiple instances of a single array adapter in multiple activities

I'm working on a newsreader, and I have two main activites, main and stories. Main calls asynctask and gets all the rss feeds, and then displays headlines when it's complete. Stories displays articles from specific feeds. There is a navbar in…
John
  • 305
  • 1
  • 2
  • 8
0
votes
1 answer

Changing style on textview in a list view row when pressed

I'd like to change the style of a textview in a list view row when that row is clicked. That text should remain focused until another row is pressed. I am using a subclass of BaseAdapter to build the row's in the list view. Would be great if I could…
user1163392
  • 167
  • 1
  • 1
  • 8
0
votes
1 answer

Android add the special item in the List View by the SimpleCursorAdapter

I have the one requirement to add the special item in the listview, which fully differnt with the others, and this is add dynamicly(when the user enter the special text) . and the listview used the SimpleCursorAdapter to show the custom item. and…
regrecall
  • 521
  • 1
  • 6
  • 20
0
votes
1 answer

Android - SimpleCursorAdapter Throws Exception

I'm trying to use a SimpleCursorAdapter to populate a ListView. However, constructing the SimpleCursorAdapter has my compiler throw me an exception. The strangest thing is that I've used almost the exact same structure to great success earlier in my…
Jason L
  • 1,812
  • 2
  • 22
  • 43
0
votes
2 answers

Android error passing context to Cursor Adapter inside OnClick(View view)

Inside a fragment, I have a button which I want to "trigger" the filling of a Listview from a database, using a Cursor Adapter. The code for the fragment goes something like this: public class TabFragment6 extends ListFragment { /** (non-Javadoc) *…
tyb
  • 4,749
  • 11
  • 31
  • 38
0
votes
3 answers

How to Change Visibility of an ImageButton within a PagerAdapter?

I want to change visibility of my image buttons within my PagerAdapter. It doesn't seem like I can refer to parts of a layout in instantiateItem through id, I can only refer to the full layout. This is strange though, because it seems that I can…
aimango
  • 1,567
  • 2
  • 15
  • 29
0
votes
6 answers

Getting issue to set the color on list view item

I have list with items having two textview and one imageview.I inflate the list with ArrayAdapter.Everything is working fine except changing list item color on click.I have 22 items in my listview. Primarily listview displaying 10 items on the…
himanshu
  • 1,990
  • 3
  • 18
  • 36
0
votes
4 answers

Get cached views from ListAdapter

When a list is shown and scrolled around, ListAdapter.getView() either creates a new list item view, or retools an existing view passed to it (as "convertView) to display new content. I'm wondering, if there's a way to get all the views created by…
SVD
  • 4,743
  • 2
  • 26
  • 38
0
votes
1 answer

List of check boxes clicked in a JSON populated android view

I am generating a list of check boxes, after parsing it from a JSON. When the submit button is pressed i want to know which all boxes are checked. How do i do this ? My xml code (Omitting very obvious stuff like height, width, xmlns etc.)…
Jaseem
  • 2,236
  • 6
  • 28
  • 35