can we fire intents from the alert dialog boxes
<p>hello friends i am new to android. I am looking to take data from the dialog box and pass it to the other activity. So i have taken an edit text and put it on to the dialog and on pressing the OK button it is not firing or not going to the other activity.instead it is terminating abruptly... please help me out of this. </p>

<pre><code>  final EditText input = new EditText(this);
        new AlertDialog.Builder(DialogBox.this)
              .setTitle("ENTER YOUR NAME")
              .setView(input)
              .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
                Intent myIntent = new Intent(getApplicationContext(), NewActivity.class);
                //myIntent.putExtra("name", value);
                startActivity(myIntent);

            }
        })
        .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
                // Do nothing.
                dialog.dismiss();
            }
        })
        .show();
</code></pre>

<p>thanks</p>
