I am trying to add an alertdialog within an alertdialog.But not able to see the second alertdialog..please help me here is my code shown
AlertDialog alertDialog = new AlertDialog.Builder(myclass.this).create(); alertDialog.setTitle("First alert"); alertDialog.setMessage("first alert press"); alertDialog.setButton("ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // here you can add functions dialog.cancel(); AlertDialog alertDialog1 = new AlertDialog.Builder(myclass.this).create(); alertDialog1.setTitle("second alert dialog"); alertDialog1.setMessage("second alert dialog details"); alertDialog1.setButton("Scan Another", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { }}); }