Example usage for android.app AlertDialog.Builder AlertDialog.Builder

List of usage examples for android.app AlertDialog.Builder AlertDialog.Builder

Introduction

In this page you can find the example usage for android.app AlertDialog.Builder AlertDialog.Builder.

Prototype

public Builder(Context context, int themeResId) 

Source Link

Document

Creates a builder for an alert dialog that uses an explicit theme resource.

Usage

From source file:org.godotengine.godot.auth.FacebookSignIn.java

public void askForPermission(final String title, final String message, final String perm, final boolean read) {

    new AlertDialog.Builder(activity, AlertDialog.THEME_HOLO_LIGHT)
            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                @Override/*from  w  ww . j a va2 s.  c  o m*/
                public void onClick(DialogInterface dialog, int id) {
                    if (!read) {
                        requestPublishPermissions(Arrays.asList(perm));
                    } else {
                        requestReadPermissions(Arrays.asList(perm));
                    }
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {

                }
            }).setTitle(title).setMessage(message).show();
}