title: android gridview lag on scroll
body: <p>I'm programming an app that has a grid view with some images, and I'm using the default vertical scroll, since not all the images can be fit into the screen. Alway I do scroll, and there is a new line to show, there seems to be a lag, on the render of the new row.</p>
  
  <p>All the images are drawables, so it is not cause by something like loading the image, at least, not explicitly. So, any ideads of how to solve the problem? The scrolling is lagged in my atrix, and the final devices the app is supposed to run in, are far worse than it.</p>
  
  <p><strong>Edit - Here some code:</strong></p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
      T item = getItem(position);
      Box box = convertView == null ? new Box(mContext) : (Box) convertView;
      onBindModel(box, item);
      return box;
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>@Override
  public void onBindModel(Box box, Model item) {
      box.param.putSerializable("model", item);
      box.setDescricao(item.getNome());
      box.getModelImageView().setImageResource(item.thumbResId);
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>So, as suggested, just tried this code, but still get the same results:</p>
  
  <pre><code>@Override
  public void onBindModel(final Box box, final Model item) {
      box.param.putSerializable("model", item);
      box.setDescricao(item.getNome());
  
      new Thread(){
          public void run() {
              Message msg = new Message();
              msg.obj =box.getModelImageView();
              msg.arg1 =item.thumbResId; 
  
              mHandler.sendMessage(msg);
          }
      }.start();
  }
  
   private Handler mHandler = new Handler() {
      @Override
      public void handleMessage(Message message) {
          Bitmap bm = BitmapFactory.decodeResource(getResources(),  message.arg1);
          setImage((ImageView) message.obj,bm);
      }
  };
  
  public void setImage(ImageView imgView, Bitmap bm) {
      imgView.setImageBitmap(bm);
  }
  </code></pre>
  
  <p>When scroll to the next line I got a hang and then it just continues normally.</p>
  
  <p>Thanks in advance</p>