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

Null pointer Exception in Custom Adapter while set the value for list item

I want to display some conditional data in List view when user request or click on button. Each list row has two value one value is name and 2nd its description. When User press button it fire command and fetch information from peripheral and match…
Nik
  • 123
  • 1
  • 1
  • 11
3
votes
2 answers

Custom ListView where all the images have the same size

I want to create a ListView where every row have a rectangular image and some Text. Like this: The problem that I have is that some image the height is higher than width and then the ListView looks like this: This is my actual code: xml…
jordiPons
  • 164
  • 5
  • 21
3
votes
3 answers

Android Custom Adapter - Won't return view?

I'm having a problem with returning my view to a listview with my custom adapter. This is what I have in my main class which extends Fragment. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle…
3
votes
4 answers

Refresh Expandable Listview

The expandable listview is proper but it doesnt get refreshed when again called. Old Items are again seen in the expandable list view. This is my adapter class. How do i refresh items in expab=ndable listview ? MyAdapter.class public class MyAdapter…
Vinit Khanna
  • 81
  • 1
  • 1
  • 10
3
votes
1 answer

A custom ListView with a custom adapter in Android Studio

Will I don't what is the problem. There are no errors nothing, and the program working perfectly. However, when I click on an item on list View it does not do anything. In other word the "Toast" won't pass This My main class: public class…
dragon3002
  • 131
  • 2
  • 4
  • 14
3
votes
6 answers

Issue in setting Textview's text in Custom Adapter for Android

I am not able to set textview's setText property inside getView() method of Custom Adapter. I already tried below solutions but it does not work for me : Solution One Solution Two Solution Three Listview.xml file :
Siddharth_Vyas
  • 9,972
  • 10
  • 39
  • 69
3
votes
1 answer

Html.fromHtml(text) not working

this works in onCreate of the activity String htmlstring="

hello world

"; tv.setText(Html.fromHtml(html)); But when i used the same from a server in a listview its not working ViewHolder holder = new…
George Thomas
  • 4,566
  • 5
  • 30
  • 65
3
votes
1 answer

Navigation Drawer custom adapter doesn't show images

I cannot get my drawer to show images, even though they are being set in the drawer adapter. It shows the text just fine, so it's not a problem of drawing it all, it's just setting the icon. This is the code for the adapter: public View getView(int…
3
votes
5 answers

android listview with custom adapter multiselection issue

I want to make a listview item selected and the text "select" to be made to "selected", but when i click an item mutiple items get selected if I select an item at position 0 , items get selected at at a pattern, that is 0,7,14,21 and if i change the…
sharath
  • 521
  • 1
  • 4
  • 18
3
votes
4 answers

how to call Activity asynctask from custom adapter in android

I have made an activity in that i have a listView and ,I have Implemeted a custom adapter for that ListView ,I have implemeted ListItem's textView's Clickevnet,In That I want to call my activity's AsyncTAk inside that customAdapter,CAn anybuddy tell…
3
votes
4 answers

Custom arrayadapter and onclicklistener for a button in a row

I have a custom arrayadapter and I want to add an onclicklistener for a button in each one of its rows, when I click on the button I want the image resource to change, everything works fine except that when I click on a button the image changes but…
3
votes
2 answers

Custom Adapter getView() not being called using PullToRefresh library

Using Chris Banes' PullToRefresh library, the getView() method of my custom adapter is not being called. This code works fine without using his library and getView() is called. I've been looking into this for a couple days now and cannot figure out…
3
votes
1 answer

Adding search functionality to gridview in android

I have custom grid adapter which contains image and text(Custom Object),on top of Gridview I have added Edittext, I would like add search functionality when ever user enter text in Edittext. Any help greatly appreciated.
user2559548
  • 89
  • 1
  • 9
3
votes
1 answer

Alertdialg with custom adapter containg checkbox and its listener

I am using custom adpater in AlertDialog. In that adapter, i am using TextView and CheckBox.. Now I want to handle CheckBox's setOnCheckedChangeListener for checking checked or unchecked CheckBox.. And according to status of CheckBox, I want to…
3
votes
1 answer

Listview with custom checkable rows backed by custom cursor adapter looses selection when recycling views

I know this question has been asked before but I have a spin on it that I just can't seem to find an elegant solution for. How can I keep track of selected checkboxes in a listview which uses a custom checkable relative layout (which has a checkbox…