Android examples for User Interface:Dialog
Create Error Dialog
//package com.java2s; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; public class Main { public static void CreateErrorDialog(Context context, String Title, String Message) {/* w ww . j a v a 2s.co m*/ AlertDialog.Builder builder1 = new AlertDialog.Builder(context); builder1.setIcon(android.R.drawable.ic_dialog_alert); builder1.setTitle(Title); builder1.setMessage(Message); builder1.setCancelable(true); builder1.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert11 = builder1.create(); alert11.show(); } }