Example usage for android.app ProgressDialog requestWindowFeature

List of usage examples for android.app ProgressDialog requestWindowFeature

Introduction

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

Prototype

public final boolean requestWindowFeature(int featureId) 

Source Link

Document

Enable extended window features.

Usage

From source file:Main.java

public static ProgressDialog showProgressDialog(Context context) {
    ProgressDialog myProgressDialog = new ProgressDialog(context);
    myProgressDialog.setMessage("Please wait...");
    myProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    myProgressDialog.show();// w w w .j  a va2 s .  c  om
    myProgressDialog.setCancelable(false);
    myProgressDialog.setOnKeyListener(new DialogInterface.OnKeyListener() {

        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
                return true;
            }
            return false;
        }

    });
    return myProgressDialog;
}

From source file:com.groupme.sdk.activity.PinEntryActivity.java

@Override
protected Dialog onCreateDialog(int id, Bundle args) {
    switch (id) {
    case DIALOG_LOADING:
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setMessage(getString(R.string.validation_waiting_message));
        return dialog;
    default://from  ww  w  .  j  ava 2  s .  c o  m
        throw new IllegalArgumentException("Unknown dialog id: " + id);
    }
}

From source file:com.groupme.sdk.activity.GroupCreateActivity.java

@Override
protected Dialog onCreateDialog(int id, Bundle args) {
    switch (id) {
    case DIALOG_CREATING:
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setMessage(getString(R.string.dialog_creating_group));

        return dialog;
    default://from w  w  w  .j av  a  2s .  co  m
        throw new IllegalArgumentException("Unknown dialog id: " + id);
    }
}