Can i create a dialog box without negative or positive buttons. That destroys it self after specific action?
AlertDialog.Builder dialog_detect= new AlertDialog.
You can do this very easily.
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
// set title
alertDialogBuilder.setTitle("Your Title");
// set dialog message
alertDialogBuilder.setMessage("Message here!").setCancelable(false);
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
// After some action
alertDialog.dismiss();
If you have a reference to the AlertDialog
somewhere else, you can still call alertDialog.dismiss()
. This closes the dialog.