getText from an EditText that is updated
<p>I have a layout where I have an EditText with a predefined text.</p>

<p>Then I have a button that, when is pressed, displays a dialog with another EditText that gets the text of the previous EditText.</p>

<p>This works fine. But when I edit the first EditText, and press the button again, it displays the old text, not the new.</p>

<p>How can I get the updated text?</p>

<p>This is the code (inside onCreateDialog) where I get the text from the first EditText:</p>

<pre><code>final View notesDialogLayout = getLayoutInflater().inflate(R.layout.notes_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(notesDialogLayout)
       .setCancelable(false)
       .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id) {
               dialog.cancel();
           }
       })

AlertDialog alert = builder.create();

mNotesEdit = (EditText) notesDialogLayout.findViewById(R.id.task_notes_dialog);
mNotesEdit.setText(mNotes.getText());
</code></pre>

<p>mNotes is just an EditText.</p>

<p>The first time the Dialog opens, it gets the updated text. From the second time, it gets always the same text, even if I edit it.</p>
