Example usage for android.app ProgressDialog STYLE_SPINNER

List of usage examples for android.app ProgressDialog STYLE_SPINNER

Introduction

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

Prototype

int STYLE_SPINNER

To view the source code for android.app ProgressDialog STYLE_SPINNER.

Click Source Link

Document

Creates a ProgressDialog with a circular, spinning progress bar.

Usage

From source file:edu.cmu.cylab.starslinger.view.HomeActivity.java

private Dialog xshowProgress(Activity act, Bundle args) {
    int maxValue = args.getInt(extra.MAX);
    int newValue = args.getInt(extra.PCT);
    String msg = args.getString(extra.RESID_MSG);
    MyLog.i(TAG, msg);/*www  .  j av  a  2 s  .co  m*/

    if (sProg != null) {
        sProg = null;
        sProgressMsg = null;
    }
    sProg = new ProgressDialog(act);
    if (maxValue > 0) {
        sProg.setMax(maxValue);
        sProg.setProgress(newValue);
        sProg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    } else {
        sProg.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    }
    if (!TextUtils.isEmpty(msg)) {
        sProg.setMessage(msg);
        sProgressMsg = msg;
    }
    sProg.setCancelable(true);
    setProgressCancelHandler();

    return sProg;
}