Example usage for android.app AlertDialog setVolumeControlStream

List of usage examples for android.app AlertDialog setVolumeControlStream

Introduction

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

Prototype

public final void setVolumeControlStream(int streamType) 

Source Link

Document

By default, this will use the owner Activity's suggested stream type.

Usage

From source file:Main.java

public static void showDialogOkWithGoBack(String title, String message, final Activity activity) {
    if (activity.getApplicationContext() != null) {
        AlertDialog.Builder adb = new AlertDialog.Builder(activity);
        adb.setTitle(title);/*  w  w  w  .ja va2 s . c  o  m*/
        adb.setMessage(message);
        adb.setCancelable(false);
        adb.setNeutralButton("OK", new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.cancel();
                //activity.onBackPressed();
            }
        });
        AlertDialog ad = adb.create();
        ad.setVolumeControlStream(AudioManager.STREAM_MUSIC);
        ad.show();
    }
}