In gridview adapter, getView(position == 0) was invoked too many times to measure layout when setImageBitmap() in a loader

后端 未结 4 1465
暖寄归人
暖寄归人 2021-02-05 05:26

I have a GridView for showing some icons.

BEFORE I had read this Displaying Bitmaps Efficiently from Android developer site, I was decoding bitmap from loca

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 06:01

    This is normal behavioral, android can call getView for same position multiple time. It's on developer to get/set thumbnail in getView only when required (i.e. If thumbnail was not set Or thumbnail path has changes). In other cases just return convertView, which we get as parameter in getView.

提交回复
热议问题