title: CheckBoxPreference with Button
body: <p>I found the answer to my question here:
  <a href="https://stackoverflow.com/questions/18090566/checkboxpreference-with-additional-%D0%B1%D1%83%D1%82%D0%BE%D0%BD">CheckBoxPreference with additional Button?</a>
  But I really did not understand how to do it. Probably due to the fact that I do not know much English.
  I need to put into ChekBoksPreferens button.
  Can anyone give an example how to do it.</p>
  
  <pre><code>import android.content.Context;
  import android.content.res.TypedArray;
  import android.graphics.drawable.Drawable;
  import android.preference.CheckBoxPreference;
  import android.preference.Preference;
  import android.util.AttributeSet;
  import android.view.View;
  import android.widget.ImageView;
  
      public class IconPreferenceScreen extends CheckBoxPreference {
  
          private Drawable mIcon;
  
          public IconPreferenceScreen(Context context, AttributeSet attrs) {
              this(context, attrs, 0);
          }
  
          public IconPreferenceScreen(Context context, AttributeSet attrs, int defStyle) {
              super(context, attrs, defStyle);
              setLayoutResource(R.layout.preference_icon);
              TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconPreferenceScreen, defStyle, 0);
              mIcon = a.getDrawable(R.styleable.IconPreferenceScreen_myIcon);
          }
  
          @Override
          public void onBindView(View view) {
              super.onBindView(view);
              ImageView imageView = (ImageView) view.findViewById(R.id.icon);
              if (imageView != null &amp;&amp; mIcon != null) {
                  imageView.getLayoutParams().height = 150;
                  imageView.getLayoutParams().width = 150;
                  imageView.setImageDrawable(mIcon);
              }
          }
  
          public void setIcon(Drawable icon) {
              if ((icon == null &amp;&amp; mIcon != null) || (icon != null &amp;&amp; !icon.equals(mIcon))) {
                  mIcon = icon;
                  notifyChanged();
              }
          }
  
          public Drawable getIcon() {
              return mIcon;
          }
  
          public class CheckBoxPreferenceSubclassWithButton{
              ???? what next ????
          }
      }
  </code></pre>