Hi Droidful. Thanks for posting your update. In actual fact, I realized there was a problem, and came back to this thread, and that's how I found your update - exactly what I needed.
But - there seems to be a new problem now. I notice that when the gallery is loaded, only three of the views are created (1, 2, and 5). The other two never get called, once 'convertView' returns non null. So you end up with only three of your five views in the gallery showing. I hope you see what I mean. I'm going to have a play and see if I can get it working, but would rather get a solution from you as it will probably be more robust! Thanks, Neil. On Jun 20, 1:47 pm, droidful <austral...@gmail.com> wrote: > Hi, my apologies, but there is a serious bug in the FlingGallery code > which results in views not being recycled. The offending function is > shown below. As can be seen the line "mExternalView = mInvalidLayout" > occurs before the call to adapter.getView, which means that in > adapter.getView the value of convertView will always be the invalid > view. I have posted the corrected class in a separate message below. > > ----------------------------------- > > public void recycleView(int newPosition) > { > if (mExternalView != null) > { > mInternalLayout.removeView(mExternalView); > } > > if (mAdapter != null) > { > // !!!! Below is the offending line of code !!! > mExternalView = mInvalidLayout; > > if (newPosition >= getFirstPosition() && newPosition <= > getLastPosition()) > { > mExternalView = mAdapter.getView(newPosition, > mExternalView, > mInternalLayout); > } > } > > if (mExternalView != null) > { > mInternalLayout.addView(mExternalView, new > LinearLayout.LayoutParams( > LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); > } > > } > > -- 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