Android examples for User Interface:Alert Dialog
Create alert dialog and set Neutral Button
//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(); } }