Create alert dialog and set Neutral Button - Android User Interface

Android examples for User Interface:Alert Dialog

Description

Create alert dialog and set Neutral Button

Demo Code


//package com.java2s;
import android.app.Activity;
import android.util.Log;
import android.app.AlertDialog;

public class Main {
    static void alert(Activity act, String Tag, String message) {
        AlertDialog.Builder bld = new AlertDialog.Builder(act);
        bld.setMessage(message);/* w  ww. ja  v a 2 s  .com*/
        bld.setNeutralButton("OK", null);
        Log.d(Tag, "Showing alert dialog: " + message);
        bld.create().show();
    }
}

Related Tutorials