Java tutorial
//package com.java2s; import android.app.Activity; import android.app.AlertDialog; public class Main { public static void showDialog(Activity context, String strTitle, String strText, int icon) { AlertDialog.Builder tDialog = new AlertDialog.Builder(context); tDialog.setIcon(icon); tDialog.setTitle(strTitle); tDialog.setMessage(strText); tDialog.setPositiveButton("Sure", null); tDialog.show(); } }