Java tutorial
//package com.java2s; import android.app.AlertDialog; import android.content.Context; public class Main { public static void showSimpleAlert(Context context, String title, String message) { if (null == title || title.trim().length() == 0) title = "Oops"; if (null == message || message.trim().length() == 0) message = "Invalid operation."; new AlertDialog.Builder(context).setTitle(title).setMessage(message).setNeutralButton("Go Back", null) .show(); } }