Okno dialogowe alertów

W moim kodzie mam okno dialogowe z ostrzeżeniem i chcę przypisać wartość zmiennej, gdy przycisk anulowania zostanie naciśnięty w tym oknie dialogowym.

Mój rzeczywisty kod to -

<code>private void clicked() {
    AlertDialog.Builder builder = new AlertDialog.Builder(Feedback.this);
    builder.setTitle("FEEDBACK");
    builder.setSingleChoiceItems(options, -1,
            new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                    switch (which) {
                    case 0:
                        String url = "http://killmathsapp.blogspot.in/";
                        Intent i = new Intent(Intent.ACTION_VIEW);
                        i.setData(Uri.parse(url));
                        startActivity(i);
                        break;

                    case 1:
                        Intent s = new Intent(Intent.ACTION_SEND);
                        s.setType("plain/text");
                        s.putExtra(android.content.Intent.EXTRA_EMAIL,
                                new String[] { "[email protected]" });
                        s.putExtra(android.content.Intent.EXTRA_SUBJECT,
                                "feedback from app");
                        startActivity(s);
                        break;

                    }

                }
            });
    AlertDialog alert = builder.create();
    alert.setCancelable(true);
    alert.show();
}
</code>

questionAnswers(3)

yourAnswerToTheQuestion