[android-developers] Re: List view with textviews and imageview, best practices
I did something similar, but the textView is populated from SQLLite. I'm still having issues with the SQLLite cursor. I tried: http://developer.android.com/reference/android/app/Activity.html#startManagingCursor%28android.database.Cursor%29 but at best it throws ugly log messages. So I'm implenting onPause, onResume etc to manage it myself, which is annoying for a ListView since ListView seems to need my cursor open. Really I just want to materialize the view, and re fetch it on resume, not leave an open database connection, it's a tiny database since every row in the database is reflected in the UI (so it crops to 10 items). That's been harder then it feels it should be. On Dec 10, 8:33 am, theSmith wrote: > Patrick, > > I would suggest using a custom ArrayAdapter that uses the 'view > holder' concept to manage the child views. > Also instead of using a linearlayout I would use a relative layout as > it will render faster because your layout tree won't be as deep. > > Im not use how you are 'lazy loading' now, but using a separate thread > that loads the images should do the trick, as it will not lock up the > UI thread. > > -theSmith > > On Dec 10, 4:19 am, Patrick Plaatje wrote: > > > Hi All, > > > i'm developing an application which has an listview. I'm currently creating > > the list item view dynamically from code (linearlayout, which includes 2 > > textviews and 1 imageview), but i'd like to use an XML resource for this. I > > read it isresource intensive when getting this view using findViewById > > within a loop. I thougth of using a custom adapter for this, but am not sure > > on how to include lazy loading of the image then. Anyone has some > > suggestions for this? > > > Regards, > > > Patrick > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: List view with textviews and imageview, best practices
1. you can look at the video from Google IO conference 2009, called Turbo charging your UI's by Romain Guy; he discussed some of the optimizations you can do when working with ListViews. 2. You can read Mark Murphy's series of ListView tutorials at android guys titled Fancy ListViews: http://www.google.co.in/url?sa=t&source=web&ct=res&cd=4&ved=0CBYQFjAD&url=http%3A%2F%2Fwhyandroid.com%2Fandroid%2F182-fancy-listviews-part-one.html&rct=j&q=androidguys+fancy+listviews&ei=JCYhS__4O9CTkAXv4sDsCg&usg=AFQjCNFmQf-vjOXIYwlkGzGNjmDQHp-cmA On Dec 10, 9:33 pm, theSmith wrote: > Patrick, > > I would suggest using a custom ArrayAdapter that uses the 'view > holder' concept to manage the child views. > Also instead of using a linearlayout I would use a relative layout as > it will render faster because your layout tree won't be as deep. > > Im not use how you are 'lazy loading' now, but using a separate thread > that loads the images should do the trick, as it will not lock up the > UI thread. > > -theSmith > > On Dec 10, 4:19 am, Patrick Plaatje wrote: > > > Hi All, > > > i'm developing an application which has an listview. I'm currently creating > > the list item view dynamically from code (linearlayout, which includes 2 > > textviews and 1 imageview), but i'd like to use an XML resource for this. I > > read it isresource intensive when getting this view using findViewById > > within a loop. I thougth of using a custom adapter for this, but am not sure > > on how to include lazy loading of the image then. Anyone has some > > suggestions for this? > > > Regards, > > > Patrick -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: List view with textviews and imageview, best practices
Patrick, I would suggest using a custom ArrayAdapter that uses the 'view holder' concept to manage the child views. Also instead of using a linearlayout I would use a relative layout as it will render faster because your layout tree won't be as deep. Im not use how you are 'lazy loading' now, but using a separate thread that loads the images should do the trick, as it will not lock up the UI thread. -theSmith On Dec 10, 4:19 am, Patrick Plaatje wrote: > Hi All, > > i'm developing an application which has an listview. I'm currently creating > the list item view dynamically from code (linearlayout, which includes 2 > textviews and 1 imageview), but i'd like to use an XML resource for this. I > read it isresource intensive when getting this view using findViewById > within a loop. I thougth of using a custom adapter for this, but am not sure > on how to include lazy loading of the image then. Anyone has some > suggestions for this? > > Regards, > > Patrick -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en