Code example for AlertDialog.Builder

Methods: create, setAdapter

0
  /** 
   * Dialog (menu) creation. Save the Dialog internally. 
   *  
   */ 
  private Dialog dialog() {
    Builder b = new AlertDialog.Builder(mCtx);
    b.setAdapter(mAdapter, new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int whichButton) {
        mEditText.setText(mAdapter.getItem(whichButton));
      } 
    }); 
    Dialog d = b.create();
    return d;
  } 
 
  /** 
   * Sets the default value of the text in the EditText portion of the ComboBox 
   *  
   * @param text 
   *          The text to set in the EditText view. 
   */