Questions tagged [android-viewbinder]

The ViewBinder is an Android class that can be used with an adapter to modify(or enhance) the way that adapter binds its data to its views.

The Android ViewBinder is designed to work with various types of adapters(like SimpleAdapter, SimpleCursorAdpter etc). This class should be used to either enable the adapter to bind data to views it doesn't support or to modify the way the adapter currently binds its data. The proper usage of a ViewBinder is to implement its setViewValue() method and then register it with the adapter(through the adapter's setViewBinder() method).

94 questions
3
votes
4 answers

Using cursor.respond(Bundle) & cursor.getextras()

I am having 2 cursors from different tables in an SQLite database. I am trying to put the data from the two cursors into one ListView but for different formatting for data from each cursor. What I thought about is using a MergeCursor to combine both…
Mohamed_AbdAllah
  • 5,311
  • 3
  • 28
  • 47
2
votes
3 answers

Using ViewBinder to update an image in a `ListView` row

I have a ListView populated from a SimpleCursorAdapter, each row containing some TextViews and an ImageView. I want to change the ImageView for each row depending on some values, however I'm trying to first figure out how to update the ImageView in…
2
votes
1 answer

ViewBinder modifies only one item in all ListView rows

I have a ListView that's populated from a SimpleCursorAdapter each row containing 3 different TextViews. I only want to modify one of the TextViews for all rows with a ViewBinder (R.id.text65), however it keeps updating all 3 TextViews of every row.…
2
votes
4 answers

CheckedTextView load default values from SimpleCursorAdapter

I have an adapter that uses a CheckedTextView and extends from a SimpleCursorAdapter. I tried to load the default values for CheckTextView but I didn't manage to do it. I don't know if this it's the behavior of CheckedTextView or I am doing…
2
votes
2 answers

How to get field value instead of column name?

I want to fill a list with data from a cursor this way: myCursor = myDBA.getAllCompanies(); startManagingCursor(myCursor); myListAdapter = new SimpleCursorAdapter(this, R.layout.company_row, myCursor, FROM, TO); …
hugoc
  • 777
  • 1
  • 6
  • 11
2
votes
2 answers

How can I have my ListView items have (and maintain) different backgrounds?

I have achieved something similar for particular items within my ListView in this question. However, now, I want the user to be able to click on items, which will essentially highlight any item the user has tapped. I keep a list of the tapped items…
finiteloop
  • 4,444
  • 8
  • 41
  • 64
2
votes
1 answer

Unable to set image into ImageView from a ListView using SimpleAdapter, ViewBinder and Asynctask

I have a problem. I'm trying to retrieve an image from a online source and the set the image into the ListView's ImageView. However, I can't do that because I can't link my ImageView within the ListView as it returns a NullPointerException. I…
2
votes
1 answer

Passing variables to a ViewBinder

I have a ViewBinder that is acting as the middleman between my ListView and a cursor adapter to a database. Depending on the context this data is being displayed in, I need the ViewBinder to do different things. As an example, take a task management…
2
votes
2 answers

how to bind a checkbox to a listview

I have a listview containing on each row a textview with a checkbox, so when the checkbox is checked and we scroll down through the listview the checkbox instance will be taken from a place to another (reused..) and I have several checked checkboxes…
2
votes
2 answers

View Binder and ClassCastException

Hi I'm having a few problems with view finder and was wondering if anyone could help. I have an SQLite database which is fine and am storing small thumbnail images in it as blobs. I know the blobs are being saved as I am able to retrieve them in…
D.Bish
  • 208
  • 1
  • 6
1
vote
3 answers

getTag() always null in onListItemClick

I have a ListView that I'm populating with a CursorAdapter like this: SimpleCursorAdapter.ViewBinder viewBinder = new SimpleCursorAdapter.ViewBinder() { public boolean setViewValue(View view, Cursor cursor, int columnIndex) { …
DannyT
  • 628
  • 1
  • 8
  • 22
1
vote
0 answers

How to use ViewBinder in SimpleAdapter with contacts?

I want to setup a ViewBinder in a SimpleAdapter and put contact photo in it. Can someone show me how? In this code I'm putting the name and number from contacts in ListView, but I don't now how to put photo. ArrayList> mapa =…
Wolf87
  • 540
  • 3
  • 11
  • 29
1
vote
3 answers

Changing text color in Listview using SimpleCursorAdapter.ViewBinder

I've listed the names from database using SimpleCursorAdapter and I want to change the color of a particular name using SimpleCursorAdapter.ViewBinder's method. I've a problem while running this method, my database contains different names but the…
1
vote
2 answers

Method for Spinner item click listener with SimpleCursorAdapter and ViewBinder

I got a Spinner element which I populate with data from a Cursor using a SimpleCursorAdapter. Also I'm using setViewBinder for a custom row layout of the Spinner. Everything works out fine, the Spinner gets the data and the Spinner items use the…
omni
  • 4,104
  • 8
  • 48
  • 67
1
vote
1 answer

Using ViewBinder for a custom ListView item with TextView

I'm trying to add a background color for an TextView on my ListView using a SimpleCursorAdapter with ViewBinder, but it doesn't work: listrow.xml: