Example usage for android.app ProgressDialog show

List of usage examples for android.app ProgressDialog show

Introduction

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

Prototype

public static ProgressDialog show(Context context, CharSequence title, CharSequence message) 

Source Link

Document

Creates and shows a ProgressDialog.

Usage

From source file:Main.java

public static ProgressDialog showProgressDialog(Context context, String message) {
    ProgressDialog dialog = ProgressDialog.show(context, "", message);
    dialog.setCancelable(true);//w  w w . j a va2s  .c  o  m
    return dialog;

}

From source file:Main.java

public static void showProgressDialog(Context c, String msg) {
    dialog = ProgressDialog.show(c, "", msg);
}

From source file:Main.java

public static void showProgressDialog(final Context ctx, String msg) {
    // if (mProgressHUD == null) {
    hideProgressDialog(ctx);//from  w  w w  .j av a 2s.  c o  m
    mProgress = ProgressDialog.show(ctx, "loading", msg);
    // }
}

From source file:Main.java

public static void showProgressDialog(Context c, int resId) {
    dialog = ProgressDialog.show(c, "", c.getString(resId));
}

From source file:Main.java

public static ProgressDialog createProgressSpinner(Context context, String title, String message) {
    ProgressDialog dialog = null;//from w w w . j av  a 2 s  .  c  om
    if (dialog == null) {
        dialog = ProgressDialog.show(context, title, message);
    } else {
        dialog.setTitle(title);
        dialog.setMessage(message);
    }
    dialog.show();

    return dialog;
}

From source file:Main.java

/**
 * Show progress dialog/*from   w ww  . j a v a  2  s.  co m*/
 * 
 * @param context
 * @param title
 * @param msg
 * @return
 */
public static ProgressDialog showProgress(Context context, String title, String msg) {
    return ProgressDialog.show(context, null, msg);
}

From source file:Main.java

public static void showSimpleProgressDialog(Context context, String title, String msg, boolean isCancelable) {
    try {//  ww w .j  a  v  a  2 s  . c o m
        if (mProgressDialog == null) {
            mProgressDialog = ProgressDialog.show(context, title, msg);
            mProgressDialog.setCancelable(isCancelable);
        }
        if (!mProgressDialog.isShowing()) {
            mProgressDialog.show();
        }

    } catch (IllegalArgumentException ie) {
        ie.printStackTrace();
    } catch (RuntimeException re) {
        re.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void showSimpleProgressDialog(Context context, String title, String msg, boolean isCancelable) {
    try {/*from   www.  j a va 2  s.c o m*/
        if (mProgressDialog == null) {
            mProgressDialog = ProgressDialog.show(context, title, msg);
            mProgressDialog.setCancelable(isCancelable);
        }

        if (!mProgressDialog.isShowing()) {
            mProgressDialog.show();
        }

    } catch (IllegalArgumentException ie) {
        ie.printStackTrace();
    } catch (RuntimeException re) {
        re.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void showProgressDialog(String title, String msg, Context context) {
    if (progressDialog != null && progressDialog.isShowing()) {
        return;// w  ww .jav a2 s.c  o m
    }
    progressDialog = ProgressDialog.show(context, title, msg);
    progressDialog.setCancelable(true);
}

From source file:ack.me.truconnectandroiddemo.DeviceInfoActivity.java

private void showDisconnectDialog() {
    final ProgressDialog dialog = new ProgressDialog(DeviceInfoActivity.this);
    String title = getString(R.string.disconnect_dialog_title);
    String msg = getString(R.string.disconnect_dialog_message);
    dialog.setIndeterminate(true);//Dont know how long disconnect could take.....
    dialog.setCancelable(false);//  w  w  w  .j a va 2  s .c o  m

    mDisconnectDialog = dialog.show(DeviceInfoActivity.this, title, msg);
    mDisconnectDialog.setCancelable(false);
}