julius wrote:
> I have a SimpleCursorAdapter for a list which returns data from a
> SQLite database as it appears in the database. I would like to be able
> to change the data as it shows in the View so if I have a long
> representing a timestamp I can format it using DateFormat.format.
> 
> Can anyone recommend a good way to go about this? (maybe I need to
> subclass SimpleCursorAdapter and override a method?)

I tend to override bindView() in a SimpleCursorAdapter subclass for
situations like this. Or, you can use setViewBinder() and create a
ViewBinder object to do it.

> I also keep a foreign key in this record so I would like to be able to
> get another object from the database and put part of this in the View
> as well.

Use a JOIN clause in your SQLite rawQuery() that builds the Cursor.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in NYC: 10-11 April 2010: http://guruloft.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to