title: How to create a custom preference with a neutral button?
body: <p>I use the code below to create a custom preference.  The xml layout file has a <code>Button</code>, <code>EditText</code> and <code>TextView</code>. This custom layout appears inside an <code>Alert</code> with "OK" and "Cancel" buttons.  This all works well.</p>
  
  <p>I would like to add a third button (a neutral button) beside the "OK and "Cancel" buttons.  I've experimented with the <code>AlertBuilder</code> class but can't figure out how to incorporate both my custom xml layout and a neutral button.  </p>
  
  <p>How can this be done?</p>
  
  <p>Currently have...</p>
  
  <pre><code>public class MelsMessage extends DialogPreference {
  
      Button bMessage;
      EditText eMessage;
      TextView tMessage;
  
      public MelsMessage(Context context, AttributeSet attrs) {
          super(context, attrs);
          // TODO Auto-generated constructor stub
      }
  
  
  
      protected View onCreateDialogView() {
  
          LayoutInflater layoutInflater = LayoutInflater.from(getContext());
          View view = layoutInflater.inflate(R.layout.dialog_pref_mess, null);
  
          //UI elements
  
          bMessage = (Button) view.findViewById(R.id.buttonMessage);
          eMessage = (EditText) view.findViewById(R.id.edittextMessage);
          tMessage = (TextView) view.findViewById(R.id.textviewMessage);
  
  
          return view;        
      }
  
  }
  </code></pre>