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
1 answer

N-level ExpandableListView

I'm trying to implement a N-level ExpandableListView and I'm using these codes for getChildView and getGroupView : @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View view, ViewGroup parent)…
Soheil Setayeshi
  • 2,343
  • 2
  • 31
  • 43
1
vote
0 answers

Multi row view with uneven columns, data from adapter

I'm trying to create a view that would take data from an adapter and distribute it next to each other in rows. The view should rely on its width to decide when to put elements in next row. Please have a look on the ilustration, of what I'm trying to…
Wojtek
  • 67
  • 1
  • 2
  • 7
1
vote
0 answers

OnClickListener stops working in Adapter's viewHolder, using with ViewPagers

I got a PagerView, inside the pager there are ListViews. At each instantiateItem(ViewGroup collection, int position) func in ViewPager's PagerAdapter, i call an AsyncTask to populate the ListView in the current PagerItem. So i got a horizontal…
1
vote
3 answers

ListView Adapter with arbitrary number of row types (Don't know the number of different row types)

So, I am making this application. The application parses a website, or more specifically a vbulletin-board. When I'm parsing a thread in the forum, I have divided it up so that when I parse each post in that thread, I get the actual content of the…
brandpost
  • 33
  • 4
1
vote
2 answers

ListView is checking my RadioButtons without them being touched

I'm trying to write a simple checklist application that contains a LinkedList view that has text and two radio buttons that indicate yes/no. The problem is that when I check one radio button as I scroll down the LinkedList changes the answers in my…
1
vote
1 answer

custom BaseAdapter in listVIew can not notifyDataSetChanged

I extends a ViewGroup which has listView in it. When I click the list item, I call the notifyDataChanged method, but it didn't work correctly, the getCount method is called but the getView method isn't called althought the getCount method return >0.…
chops
  • 11
  • 4
1
vote
2 answers

Use getView() without Layout Inflater

I want to populate items without using a xml layout instead I want to create view at the runtime.This is my getView() method. public View getView(final int position, View convertView, ViewGroup parent) { EditText v ; if(convertView…
1
vote
2 answers

Getting String from TextView inside from ListView adapter

Here is a method I have: public static void updateRowForReview(int itemRowPosition) { adapter.getWasReviewed(itemRowPosition); updateReviewAtPosition(itemRowPosition); } private static void updateReviewAtPosition(int position) { View…
TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259
1
vote
2 answers

animate a child view of listview in position 1

I created a code that animates all the children of the ListView except the position 1. if I reduce the application with the "home" button and I come back on, the animation of the view at position 1 is not launched. So if I press a "Preferences"…
julien dumortier
  • 1,303
  • 1
  • 13
  • 28
1
vote
1 answer

Android Adapt Data from a SQLite Database to a Listview

EDIT: After spending almost all day on this OutOfMemory Error I was getting, turns out I simply wasnt advancing a cursor. However, I still wish to obtain an answer for my question below. To clarify, my question is: Is it faster to make a custom…
pogo2065
  • 226
  • 1
  • 3
  • 14
1
vote
1 answer

Customizing SimpleCursorAdaper in android

I have to load data from the cursor to listview in my app. Here is my custom adapter class. And it works fine. But I need to show a separate layout for very first row of the listview. The first row in list will have an extra imageview. How can I do…
Santhosh
  • 4,956
  • 12
  • 62
  • 90
1
vote
1 answer

Two async calls in getview(), am I doing this right?

So, I have a custom GalleryAdapter where I stream images from web with the help of an Async ImageLoading Library via ajax calls (lib name is Aquery). With the images those I stream from web, I have a corresponding audio track also, with every image…
Prateek
  • 3,923
  • 6
  • 41
  • 79
1
vote
1 answer

Gridview setEnabled not working for the first item

I have a strange problem today. I am trying to implement a game where I have a gridview with some buttons. When any of the buttons are clicked, it get disabled (using setEnabled(false)). The problem is, only the first button is not getting disabled.…
Rafi Kamal
  • 4,522
  • 8
  • 36
  • 50
1
vote
2 answers

Null Pointer exception in ViewPager Fragment with GridView and custom Adapter

I am getting a null pointer exception on the line where I am setting the adapter (at mGrid.setAdapter(new AppsAdapter());. As far as I can see everything in the adapter is pointing to something valid. I am trying to display a grid of icons that are…
1
vote
2 answers

Start activity from adapter don't work with SwipeListView library

I'm using SwipeListView library and I'm getting error when trying to start an activity in my adapter. public class ProductAdapter extends ArrayAdapter { private Context context; public ProductAdapter(Context context, int…
tsil
  • 2,069
  • 7
  • 29
  • 43