How to get value EditText from customDialog
<p>My scenario, there is a button in the main screen, when user click the button, a dialog form comes out with a textedit and 2 button. My problem is when I try to get the value from edit text it seems nothing happen, and the value is always NULL. </p>

<p>This is my code: I declare dialog inside the main activity</p>

<pre><code>private void popup() {
        AlertDialog.Builder builder;
        AlertDialog alertDialog;

        LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
        View dialog = inflater.inflate(R.layout.isbn_dialog,
                                       (ViewGroup) findViewById(R.id.layout_root));

                    // The edit text from dialog
        isbnInput = (EditText)dialog.findViewById(R.id.isbn);

        builder = new AlertDialog.Builder(this);
        builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {

            }
        });
        builder.setPositiveButton("Add", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                Toast.makeText(getApplicationContext(), isbnInput.getText().toString(), Toast.LENGTH_LONG);
            }
        });

        builder.setView(dialog);
        alertDialog = builder.create();
        alertDialog.setTitle("Enter ISBN Number");
        alertDialog.show();
}
</code></pre>

<p>So how can I get the value from dialog edit text properly ?</p>
