Example usage for android.app ProgressDialog getWindow

List of usage examples for android.app ProgressDialog getWindow

Introduction

In this page you can find the example usage for android.app ProgressDialog getWindow.

Prototype

public @Nullable Window getWindow() 

Source Link

Document

Retrieve the current Window for the activity.

Usage

From source file:Main.java

public static ProgressDialog showProgressDialog(Context context, String text) {
    if (null != context) {
        ProgressDialog dialog = new ProgressDialog(context);
        dialog.setMessage(text);//from  w ww  . java  2s. c  o m
        dialog.setIndeterminate(true);
        dialog.setCancelable(false);
        dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        dialog.show();
        return dialog;
    }
    return null;
}