类型化数组在与#recycle() 一起使用后应回收
我的代码显示此警告消息:
类型化数组在使用后应与 #recycle() 一起使用后回收以获得的类型化数组
法典:
public View getView(int i, View view, ViewGroup viewgroup)
{
ImageView imageview;
if (view == null)
{
imageview = new ImageView(b);
imageview.setLayoutParams(new android.widget.AbsListView.LayoutParams(110, 110));
imageview.setPadding(1, 1, 1, 1);
imageview.setAdjustViewBounds(false);
imageview.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
} else
{
imageview = (ImageView)view;
}
imageview.setImageResource(a.getResources().obtainTypedArray(0x7f050000).getResourceId(i, -1)); //*warning*Typed Array should be recycled after use with #recycle()
return imageview;
}