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

Android: java.lang.nullPointerException at custom ListView adapter

I'm trying to make a custom view for my ListView, but the app crash when try to open it. I read a lot of pages but don't find the solution. Please help me! This is my custom Adapter: public class AdaptadorCatalogo extends BaseAdapter { protected…
1
vote
0 answers

notifyDataSetChanged(); inside filter shows wrong items for a listview

public void filter(String charText) { charText = charText.toLowerCase(Locale.getDefault()); dataOrig.clear(); if (charText.length() == 0) { dataOrig.addAll(arraylist); } else { for (User wp…
tony9099
  • 4,567
  • 9
  • 44
  • 73
1
vote
1 answer

Custom BaseAdapter ListView onItemClickListener in DrawerLayout Not Called

I have a Custom Base Adapter I am using with my ListView in a DrawerLayout. The ListView inflates ok, but I cannot call the onItemClickListener. Here is the onCreate portion of the MainAcitivty, where I set the adapter and the…
Tykin
  • 492
  • 2
  • 8
  • 16
1
vote
2 answers

Error appears when changing ArrayAdapter to custom Adapter that extends ArrayAdapter

Basically what I have is a fragment which displays a ListView. It currently uses an ArrayAdapter. However I'm trying to extend the ArrayAdapter to make my own custom adapter. Then, when I change the code to use my new adapter, the following error…
Gak2
  • 2,661
  • 1
  • 16
  • 28
1
vote
0 answers

Are adapters only for ListViews?

I want to have a kind of view manager object to provide fragments created, chosen and changed at runtime for inclusion in a two-paned xml layout. Can I get this type of functionality by deriving from an adapter?
Sinthia V
  • 2,103
  • 2
  • 18
  • 36
1
vote
0 answers

Memory leak in gridadapter cannot find where? and how can i improve my logic to avoid GC calls?

How can i improve my logic to reduce memory consumption and fast UI as it lags while scrolling because of GC call. I user Eclipse MAT and found 3 suspects : Problem Suspect 1 One instance of "android.graphics.Bitmap" loaded by "" occupies 500,464…
Vikas Rathod
  • 374
  • 2
  • 14
1
vote
1 answer

Strange bug in listfragment

I wanted to study android sqlite so I created an instant tagging application in which a user can tag his photos and upload them to his network (google+, fb, twitter) problem is I have a ListFragment in which the user can see all the tagging he made,…
crazyPixel
  • 2,301
  • 5
  • 24
  • 48
1
vote
1 answer

listView setAdapter null pointer exception?

I read a lot of post about this situation but ı can't find where ı'am wrong I need your help end advise :) I try to make popoverView which show a search result. User post the searchKey. I have to parse json object which return from web services, and…
1
vote
1 answer

How do I pass information into getView of a custom ArrayAdapter?

I have the following class in my application: public class Player implements Parcelable { private String name; private int playerColor; private int[] scores; ... } How do I tell the getView method of my ArrayAdapter which element of…
CovertDad
  • 57
  • 7
1
vote
0 answers

Passing data from BaseAdapter to DialogFragment

i develop Android app, which needs to get JSON data from outside API - and create the Dialog with MultiChoice options using this data. I dont really know if it's good idea, but Im getting API data with BaseAdapter, and I want to send them into my…
pawel
  • 5,976
  • 15
  • 46
  • 68
1
vote
0 answers

Insert new data in Custom Adapter and update list

I have an list with an custom adapter, and upon refresh I want to add new data to be displayed(if any available). But the list isn't being update. I tried all the methods with notifyDataSetChanged for the adapter but it's not updated. Please help. I…
Ionut Negru
  • 6,186
  • 4
  • 48
  • 78
1
vote
0 answers

update android fragment contents view.invalidate()

I have a simple fragment inside of an activity, and i need it to update its contents. I have the handle to the root views, but view.invalidate() does'nt do anything. When I pop the fragment off the back-stack and push it again, then it updates it…
1
vote
0 answers

ListView shows wrong placement of images taken from URL

My listview doesn't show exact placement of images on its individual custom adapters. I am trying to load the images using AsyncTask. Sometimes the images duplicates and I don't have any idea why. Here is my ArrayAdapter code: public class…
1
vote
1 answer

Base Adapter with two different types of rows

I have created a Custom adapter to fill ListView extending base adapter. In my layout each row have same views (One RelativeLayout, other TextView) .But row layout may be different like in one on left hand side ,I have shown RelativeLayout.On other…
1
vote
0 answers

Possible to cancel notifyDataSetChanged (adapter refresh)?

Once I have issued notifyDataSetChanged on my custom BaseAdapter, is there a way to cancel the refresh of the adapter? For example, I return to some screen and notifyDataSetChanged has been called to refresh the ListView or GridView. A user then…
sandalone
  • 41,141
  • 63
  • 222
  • 338