title: How to open Dialog with EditText element so that all text is selected and keyboard is showed?
body: <p>I want to open AlertDialog with EditText element, so that keyboard is show and whole text is selected? </p>
  
  <p>that is wath I try:</p>
  
  <pre><code>public void showRenameDialog(Task task) {
  
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      builder.setTitle("Enter the title of Task");
  
      final EditText input = new EditText(this);
      input.setId(TEXT_ID);
      input.setText(task.getTitle());
      input.setSelectAllOnFocus(true);
      builder.setView(input);
      final Task t = task;
      builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
  
          @Override
          public void onClick(DialogInterface dialog, int whichButton) {
   ...
          }
      });
  
      builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  
          @Override
          public void onClick(DialogInterface dialog, int which) {
              return;
          }
      });
      AlertDialog alertDialog = builder.create();
      alertDialog.show();
      InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.showSoftInput(input, InputMethodManager.SHOW_IMPLICIT);
  }
  </code></pre>
  
  <p>the text is selected, but the keyboard isn't showed.</p>
  
  <p>Ant when I touch the text, keyboard go open, but the text is no more selected.</p>