Okay - I figured out something. Hope this helps someone else.
This post had a similar issue:
http://groups.google.com/group/android-developers/browse_thread/thread/8d3f9c450d00d8a6/ffd344b52f707f57
But I need to target 1.5 so setTag won't work. Instead I adjusted the if
statement to check to see if the image had already been instantiated a la:
if ((convertView == null) && (imageViews[position] == null)) {
Jason Van Anden
http://www.bubblebeats.com
On Mon, Jul 19, 2010 at 9:45 AM, Jason Van Anden
<[email protected]>wrote:
> Hi All,
>
> I am attempting to load a series of images into a 3x3 gridview. When the
> user refreshes the screen I want images to load into each imageview
> randomly. All of the images load properly - except index zero (topmost
> leftmost). In testing, this will work the first time I load if zero happens
> to be the first index randomly picked - but thereafter - nothing. I suspect
> the trouble is in how I am dealing with getView within the BaseAdapter.
> Here is what I have:
>
> public View getView(int position, View convertView, ViewGroup
> parent)
> {
> ImageView imageView = (ImageView)convertView;
>
> if (convertView == null) {
> imageView = new ImageView(context);
> imageView.setLayoutParams(new GridView.LayoutParams(85,
> 85));
> imageView.setScaleType(ImageView.ScaleType.FIT_XY);
> imageView.setPadding(1, 1, 1, 1);
> imageView.setOnClickListener(ShowArtistSummary);
> imageView.setAnimation(anim_fade_in);
>
> } else {
> imageView = (ImageView) convertView;
> }
>
> imageViews[position] = imageView;
> return imageView;
> }
>
> The imageViews array is used later to load the bitmaps randmly.
>
> Help appreciated.
>
> j
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en