Code example for ImageView

Methods: setImageDrawable, getResources

0
   * @param drawable 
   * @return image view 
   */ 
  public ImageView setDrawable(final int id, final int drawable) {
    ImageView image = imageView(id);
    image.setImageDrawable(image.getResources().getDrawable(drawable));
    return image;
  } 
 
  /** 
   * Register on checked change listener to child view with given id 
   * 
   * @param id 
   * @param listener 
   * @return view registered with listener 
   */ 
  public CompoundButton onCheck(final int id,
      final OnCheckedChangeListener listener) {
    CompoundButton checkable = find(id);
    checkable.setOnCheckedChangeListener(listener);
    return checkable;