Custom item in ListActivity on Android

I've spent hours reading SDK help, searching the web and reading tutorials - but I still can't figure it out.

I would like to know how to create a custom list item in ListActivity widgets on Android. Something similar to the Twitter client interface. Each list item has different types of text, maybe an icon, etc.

The problem is with the data in the list item. If you define your own data structure, say "Tweet", which will save the post, author, submitted date, and image url. How do I link a Tweet instance to a custom list item?

Does anyone know of any resources to help me understand the process of creating something like this?

Any guidance would be greatly appreciated. Thanks to

+2


a source to share


1 answer


I'm not sure which tutorials you've read, but it's pretty simple. You define your layout. You use it in your getView for your items. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html



you can also look at Mark's example with lazy loading images http://github.com/commonsguy/cwac-thumbnail

+4


a source







All Articles