Code example for ImageView

Methods: setImageDrawablesetVisibility, invalidate

0
 
    if (image != null) {
      Drawable img = contents.getImage();
 
      if (img != null) {
        image.setImageDrawable(img);
        image.setVisibility(VISIBLE);
        image.invalidate();
      } else { 
        // If this info field doesn't have a drawable now, no point 
        // in drawing the image view 
        image.setVisibility(INVISIBLE);
      } 
    } 
    // Redraw our drawable too 
    // if (image != null && image.getVisibility() == VISIBLE) 
    // image.invalidate(); 
  } 
 
  /** 
   * Handles updates from the infofield, but guaranteed to run in the gui thread