Create not Cancellable Alert - Android android.app

Android examples for android.app:AlertDialog

Description

Create not Cancellable Alert

Demo Code

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;

public class Main{

    public static void notCancellableAlert(Activity activity, String msg,
            DialogInterface.OnClickListener okListener) {
        new AlertDialog.Builder(activity)
                .setTitle(android.R.string.dialog_alert_title)
                .setMessage(msg)/*  w ww  .ja v  a 2  s . co  m*/
                .setPositiveButton(android.R.string.ok, okListener)
                .create().show();
    }

}

Related Tutorials