Create an auto-dismissable Alert Dialog in Android

Handler handler = new Handler();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("This dialog will be dismissed in 30 seconds");
final AlertDialog dialog = builder.create();;
handler.postDelayed(new Runnable() {
public void run() {
}, 30000); // Dismiss in 30 Seconds

Leave a Reply

Your email address will not be published. Required fields are marked *