Android examples for User Interface:Dialog
add Message Confirm dialog
//package com.java2s; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface.OnClickListener; public class Main { public static void addMsgConfirm(Activity activity, String titulo, String msg, int icone, OnClickListener listener) { AlertDialog.Builder builderDialog = new AlertDialog.Builder( activity);/* ww w . ja va 2 s .co m*/ builderDialog.setTitle(titulo); builderDialog.setMessage(msg); builderDialog.setPositiveButton("Sim", listener); builderDialog.setNegativeButton("asdf", null); builderDialog.setIcon(icone); builderDialog.show(); } }