Code example for ImageView

Methods: setImageDrawablesetVisibility

0
     * Sets the app icon, creating it if necessary. 
     */ 
    public void setAppIcon(Drawable icon) {
        if (icon != null) {
            if (mIconView == null) {
                mIconView = new ImageView(mContext);
                addView(mIconView);
            } 
            mIconView.setImageDrawable(icon);
            mIconView.setVisibility(View.VISIBLE);
        } else { 
            if (mIconView != null) {
                mIconView.setVisibility(View.GONE);
            } 
        } 
    } 
 
    /** 
     * Sets up the status icon, creating it if necessary. 
     */ 
    public void setStatusButton(Drawable icon, int id, long appId) {