Java tutorial
//package com.java2s; import android.app.AlertDialog; import android.content.Context; public class Main { /** * create dialog */ public static void callDialog(Context ctx, String msg, String title) { AlertDialog.Builder builder = new AlertDialog.Builder(ctx); builder.setMessage(msg).setTitle(title).setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); dialog.show(); } }