Caixa de Diálogo Alerta
Eu tenho uma caixa de diálogo de alerta no meu código e quero atribuir um valor a uma variável como o botão de cancelamento é pressionado para esse diálogo.
Meu código atual é -
<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>