I’m trying to recycle the gridview items, as the current solution works but is laggy and eats up resources. However, i can’t figure out how to. The android developer site’s example didn’t work for me.
my getview() method:
public View getView(int position, View paramView, ViewGroup paramViewGroup) {
long starttime = System.currentTimeMillis();
View localView = MMWeb.this.getLayoutInflater().inflate(R.layout.grid_item, null);
TextView localTextView = (TextView)localView.findViewById(2131034115);
ImageView localImageView = (ImageView)localView.findViewById(2131034114);
cItem = items.get(position);
cItem.add(Integer.toString(position));
localTextView.setText(getItemName());
Bitmap localBitmap = d.getImage(cItem.get(3), cItem.get(2));
localImageView.setImageBitmap(localBitmap);
Common.toLog("getView took "+ (System.currentTimeMillis() - starttime) + " ms");
return localView; }
Can someone point me in the right direction?? any suggestions on how to solve this will be appreciated!
Just use
paramView, which is the reusable view passed by your adapterview as it is no longer visible on the screen.