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

Json Parsing using Async Task and BaseAdapter

I'm accessing http://graph.facebook.com/xyz and displaying name,id and gender in ListView. I don't know how to call the result from doInBackground and BaseAdapter. public class FbMainActivity extends Activity { Button b; ListView…
DroidLearner
  • 2,115
  • 5
  • 31
  • 50
1
vote
0 answers

android: how to set listener for Viewgroup and its child views at the same time?

I'm using a customized adapter for my listview. Here is the code: public class ContentAdapter extends ArrayAdapter{ private ArrayList items; public ContentAdapter(Context context, int textViewResourceId,…
Allen
  • 47
  • 7
1
vote
1 answer

Android multiple Listviews on single activity not showing items

I have an activity with 2 Listviews- PairedListView and NewDevicesListView and a scanbutton. Initially, onCreate() the activity should display all the bluetooth paired devices and the scan button. On pressing Scan button, it should display the 2nd…
1
vote
1 answer

Removing ListView item with dialog

I'm trying to remove a ListView item via a dialog however that item (message) is created in a separate onClick() event: final Button addButton = (Button) findViewById(R.id.Button1); addButton.setOnClickListener(new View.OnClickListener() { …
Ryan Sayles
  • 3,389
  • 11
  • 56
  • 79
1
vote
1 answer

Calling MyAdapter in an easy way?

I want to make a timetable app for the buses of my city. But, my code is too long. I have a MyAdapter class but as each bus line needs a different adapter my code started to seem like this: MyAdapter list1 = new MyAdapter(this, …
Onur
  • 134
  • 2
  • 16
1
vote
2 answers

Updating the ListView

I'm working on a program that uses a ListView which contains strings that a user enters. I want it to list out each string after the user clicks the button. Also I want every string value that is displayed in the ListView to also be in an array so…
Ryan Sayles
  • 3,389
  • 11
  • 56
  • 79
1
vote
1 answer

ListView items - going Back and Forth

Ok, I have a ListView inside a DialogPreference that is populated with an CustomAdapter extending BaseAdapter. When the dialog comes up the first time, it shows a list of Root directories that I get from a web api. Once the user clicks on one of the…
Harry
  • 13,091
  • 29
  • 107
  • 167
1
vote
2 answers

Unable to return two different views from getView in adapter

Developing my very first app I'm trying to add sections to my elements in a list view. All items a have a date and I want to return a simple layout containing a date each time the date changes. In my adapter I have the following: public View…
CJe
  • 1,928
  • 3
  • 24
  • 53
1
vote
0 answers

Custom AdapterView with complex positioning of children

I am trying to implement a custom AdapterView that draws it's child in own way following Making your own 3D list. What i am trying to do is draw the children in sort of a surface where they are positioned irregularly and are of irregular sizes. The…
1
vote
1 answer

Updating ListView after animation

My app has a sliding drawer for notifications. I've managed to get it to function like the android notifications including the "clear all" button. When the clear all button is clicked my database is cleared, my list adapter is refreshed, and my…
1
vote
0 answers

How to create sectioned adapter with LoadManager

Here is example with use of LoadManager http://developer.android.com/reference/android/app/LoaderManager.html example of sectioned adapter is private class SectionAdapter extends SectionedAdapter { @Override protected View getHeaderView(String…
Lukap
  • 31,523
  • 64
  • 157
  • 244
1
vote
0 answers

How to create Multiple Gallery in an activity dynamically?

I want to display multiple Gallery in my Application. The number of gallery depends on the input which i get while running. Im confused to create it dynamically. Please help me. Following are the idea's which im planning to do. Creating Gallery…
Vignesh
  • 2,295
  • 7
  • 33
  • 41
1
vote
3 answers

Android gridview maintain the state when changes orientation but need to update views

Am having a gridview which sets the views based on the gridview size and the col width, everything fine when we start but when i change the orientation, the views are recreated and the check boxes which are checked are refreshed, which i dont want.…
1
vote
1 answer

Android Custom ListView Issue

In my app, I want to do groups of each posts in same post category. Listview doesn't refresh of items counts. Forexample, ".Net" category has 3 posts. Listview has 15 rows. 12 rows are seem empty. How can I refresh listview rows count ? I tried…
1
vote
2 answers

using IF condition to change imageview

this app will get get son from server. The value that I want to use is categoryid. you know clearly in the code below. How can I use categoryid that from json to make condition to change imageview? Hint: my ImageView is in ImageAdapter class and I…
kongkea
  • 9,788
  • 12
  • 39
  • 49