[android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Mark Wyszomierski
Hi, I'm looking at List8 in the sdk api samples folder. In this example, the list adapter doesn't recycle 'convertView': public View getView(int position, View convertView, ViewGroup parent) { // Make an ImageView to show a photo ImageView i = new ImageView(mContext);

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Mark Murphy
Mark Wyszomierski wrote: I thought though that in earlier versions of the SDK that listview would internally release views more quickly if you weren't using convertView, and were allocating all of them like in the above example? I don't think that was the case. I think the example is just

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Romain Guy
*Always* reuse convertView. On Tue, Mar 2, 2010 at 7:09 AM, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: I thought though that in earlier versions of the SDK that listview would internally release views more quickly if you weren't using convertView, and were allocating

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Mark Murphy
Romain Guy wrote: *Always* reuse convertView. Should we file a bug report, then, for the List8.java SDK sample? That *was* the context of this discussion. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List8.html -- Mark Murphy (a Commons Guy)

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Romain Guy
Even better, submit a patch :) On Tue, Mar 2, 2010 at 10:43 AM, Mark Murphy mmur...@commonsware.com wrote: Romain Guy wrote: *Always* reuse convertView. Should we file a bug report, then, for the List8.java SDK sample? That *was* the context of this discussion.

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Mark Murphy
Romain Guy wrote: Even better, submit a patch :) Only if I decide to write a book on how to work with the firmware and contribute to the AOSP. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org -- You

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Romain Guy
That's sad :( On Tue, Mar 2, 2010 at 10:49 AM, Mark Murphy mmur...@commonsware.com wrote: Romain Guy wrote: Even better, submit a patch :) Only if I decide to write a book on how to work with the firmware and contribute to the AOSP. -- Mark Murphy (a Commons Guy) http://commonsware.com |

Re: [android-developers] List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Mark Murphy
Romain Guy wrote: That's sad :( :: shrug :: It's going to take a metric buttload of work for me to navigate the whole process, in particular figuring out everything the site instructions don't tell me. If I'm going to do that work, I'm going to do it seriously, which means not just to fix an