Java tutorial
//package com.java2s; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; public class Main { public static void showAlert(Context context, String title, String text) { AlertDialog alertDialog = new Builder(context).create(); alertDialog.setTitle(title); alertDialog.setMessage(text); alertDialog.setCanceledOnTouchOutside(true); alertDialog.show(); } }