Re: [android-developers] ExpandableListView advice
Thanks for the feedback. I have done more research and optimized the code so that scrolling is lot smoother. On Friday, June 8, 2012 3:27:06 AM UTC+10, TreKing wrote: as soon as I receive an item, I have to immediately add it, sort it and display it. Use a collection data structure that maintains sorting and is optimized for inserting new elements. Adding an item to an ArrayList and then sorting *each time* is asking for slowness. So how can I properly implement the 'getGroupView' function so that it has the correct convertView of my item at any given time? Updating the convertView is what you're supposed to be doing, as it can and will contain data from rows that no longer visible and thus eligible for recycling. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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
Re: [android-developers] ExpandableListView advice
The same thing I have expanding list view my doubt I solved. Regards Jagadeesh Sent from my HTC - Reply message - From: Ash anan...@gmail.com To: android-developers@googlegroups.com Subject: [android-developers] ExpandableListView advice Date: Fri, Jun 8, 2012 11:51 am Thanks for the feedback. I have done more research and optimized the code so that scrolling is lot smoother. On Friday, June 8, 2012 3:27:06 AM UTC+10, TreKing wrote: as soon as I receive an item, I have to immediately add it, sort it and display it. Use a collection data structure that maintains sorting and is optimized for inserting new elements. Adding an item to an ArrayList and then sorting *each time* is asking for slowness. So how can I properly implement the 'getGroupView' function so that it has the correct convertView of my item at any given time? Updating the convertView is what you're supposed to be doing, as it can and will contain data from rows that no longer visible and thus eligible for recycling. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 -- 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] ExpandableListView advice
Hi All, Wondering if someone can advice me on the following issue I have with my application. My app (running on Android 2.2) has an expandable list view. It connects to a server and receives a number of items. Items can be none or in the range of 100's. I do not get a count of how many items I will receive. The items just keep coming. The items also come in random order. Each item has a unique ID. I would like to present these items on my ExpandableListView in a sorted manner (sorted by unique ID). Also each item will have one child which presents the user with information on that list (mostly in the form of textview and images).. For every new item that I receive from the server, I will add it to my local buffer (ArrayList). Once added, I sort the array and then add it to the ExpandableListView and call notifyDataSetChanged. The problem is that in the function getGroupView, convertView is only null the very first time. Once I inflate view it will use that, however, after sorting, the view then holds incorrect data. To solve the issue of showing correct data, I have to update the converView to show new data. However, then then presents a jerky scrolling as a lot of garbage collection starts to take place (as seen in LogCat). As I do not have any method of knowing that I have received all data from the server, I cannot wait on any external flag which means that as soon as I receive an item, I have to immediately add it, sort it and display it. So how can I properly implement the 'getGroupView' function so that it has the correct convertView of my item at any given time? Any advice would be appreciated. Thanks -- 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
Re: [android-developers] ExpandableListView advice
On Thu, Jun 7, 2012 at 6:37 AM, Ash anan...@gmail.com wrote: as soon as I receive an item, I have to immediately add it, sort it and display it. Use a collection data structure that maintains sorting and is optimized for inserting new elements. Adding an item to an ArrayList and then sorting *each time* is asking for slowness. So how can I properly implement the 'getGroupView' function so that it has the correct convertView of my item at any given time? Updating the convertView is what you're supposed to be doing, as it can and will contain data from rows that no longer visible and thus eligible for recycling. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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