Questions tagged [custom-adapter]

A custom-adapter is an interface which provides the ability to define non-standard iterators for specific data representations.

A custom-adapter is often used to integrate custom data structures with a view in an MVC framework.

References

990 questions
238
votes
13 answers

Custom Adapter for List View

I want to create a custom adapter for my list view. Is there any article that can walk me through how to create one and also explain how it works?
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
81
votes
10 answers

Custom Listview Adapter with filter Android

Please am trying to implement a filter on my listview. But whenever the text change, the list disappears.Please Help Here are my code. The adapter class. package com.talagbe.schymn; import java.util.ArrayList; import…
olakunle
  • 851
  • 1
  • 7
  • 9
29
votes
6 answers

How to use search functionality in custom list view in Android

I have created a list view with multiple items in row. I have also created a search box above. I want to implement search functionality on the basis of particular fields of the list. How can I achieve this? Any help will be appreciated.
Nitesh Kabra
  • 509
  • 2
  • 9
  • 17
26
votes
2 answers

notifyDataSetChange not working on RecyclerView

I'm working with Android's new RecyclerView but I can't get my custom adapter to refresh whenever I call one of the "notify" methods. I've tried calling notifyDataSetChanged, notifyItemRangeInserted and notifyItemInserted and none of them seem to…
14
votes
1 answer

How can inflate a layout containing listview in a alert dialog?

I am using a listview with a custom adapter in a layout. Now i am trying to bring that layout containing list to my alertdialog. I tried to bring simple layouts not containing list to alert dialog with this code and its is working good. But i am…
arnp
  • 3,178
  • 6
  • 26
  • 43
13
votes
3 answers

How to use setTag and getTag with custom adapter

I get stucked and I need help. I'm trying to use set and get Tag but i can't get how it works for this action: I'm using list view to show images loaded to extended adapter The custom Adapter inflate a layout with imageview_1, textview_1 and…
Jonatan
  • 413
  • 1
  • 5
  • 20
12
votes
5 answers

Android AutoCompleteTextView shows object information instead of text in landscape mode

I am using a Custom Adapter with AutoCompleteTextView. It works fine on the emulator and my tablet. However, there is an issue on my phone in landscape mode. The auto complete hints being shown in this mode are object info rather than text. However,…
Sriman
  • 788
  • 9
  • 25
12
votes
2 answers

How to let OnClick in ListView's Adapter call Activity's function

I have an Android application with a ListView in it, the ListView will setup fine but now I want a image in the ListView to be clickable. I do this by using 2 classes, the Activity class (parent) and an ArrayAdapter to fill the list. In the…
user1321683
  • 183
  • 1
  • 2
  • 5
11
votes
2 answers

Unable to set margin of item in ListView using custom Adapter

I am attempting to set variable left margins for items in my ListView. The problem occurs in my custom Adapter in the getView method: public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null){ …
Patrick Dattilio
  • 1,814
  • 3
  • 21
  • 35
11
votes
1 answer

After maintaining collapse/expand state for N-level or Multilevel expandablelistview some subgroups are not displayed

I worked a lot to create **N-level expandableListView. I am able to make it to any level but my requirement is to maintain the state of opened groups even after scroll. I tried with multiple ways but still unsuccessful. This Expandable listview is…
11
votes
1 answer

Items in listView have white text when using setAdapter in UI thread

For another listView in another activity the text color of the items is black, like it should be. However, in another activity when using setAdapter in a new thread when the new items created the text color is white when I want it black. Here is the…
user3864563
  • 365
  • 1
  • 7
  • 22
9
votes
1 answer

Selecting/highlighting multiple items in listview with custom adapter - Android

I followed a good tutorial, with some changes, to create a custom ListView that will allow me to display multiple images for each row in my ListView. What I would like to do is highlight by selecting multiple items in the list and then perform some…
Willis
  • 5,308
  • 3
  • 32
  • 61
8
votes
1 answer

Highlight effect while pressing item in custom ListView adapter

There's a system visual effect everytime you click a view in Android. In Lollipop it's the ripple effect. When I created a ListView and associated it to an ordinary ArrayAdapter, this effect was present. Now that I've added a custom ListView, this…
ZShock
  • 255
  • 3
  • 12
8
votes
2 answers

How to get data from custom adapter in ListView?

here is my problem : I created a custom adapter for my ListView and I get information out of a List that I give to that adapter in order to let him fulfill my ListView. He does everything correctly. Now I'd like to implement an OnItemClickListener…
Kevin Gilles
  • 463
  • 1
  • 8
  • 23
8
votes
4 answers

filtering custom adapter IndexOutOfBoundsException

I'm novice at android. My custom Adapter cause exception when filtering. here is my code. private class DeptAdapter extends ArrayAdapter implements Filterable { private ArrayList items; private ArrayList mOriginalValues; …
user1788012
  • 179
  • 2
  • 8
1
2 3
65 66