add Message Confirm dialog - Android User Interface

Android examples for User Interface:Dialog

Description

add Message Confirm dialog

Demo Code


//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();
    }
}

Related Tutorials