android.app.ProgressDialog.setOwnerActivity()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(222)

本文整理了Java中android.app.ProgressDialog.setOwnerActivity()方法的一些代码示例,展示了ProgressDialog.setOwnerActivity()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressDialog.setOwnerActivity()方法的具体详情如下:
包路径:android.app.ProgressDialog
类名称:ProgressDialog
方法名:setOwnerActivity

ProgressDialog.setOwnerActivity介绍

暂无

代码示例

代码示例来源:origin: WVector/AppUpdate

public static void showProgressDialog(final Activity activity, String msg, boolean cancelable, DialogInterface.OnCancelListener listener) {
  if (activity == null || activity.isFinishing()) {
    return;
  }
  if (sCircleProgressDialog == null) {
    sCircleProgressDialog = new ProgressDialog(activity);
    sCircleProgressDialog.setMessage(msg);
    sCircleProgressDialog.setOwnerActivity(activity);
    sCircleProgressDialog.setOnCancelListener(listener);
    sCircleProgressDialog.setCancelable(cancelable);
  } else {
    if (activity.equals(sCircleProgressDialog.getOwnerActivity())) {
      sCircleProgressDialog.setMessage(msg);
      sCircleProgressDialog.setCancelable(cancelable);
      sCircleProgressDialog.setOnCancelListener(listener);
    } else {
      //不相等,所以取消任何ProgressDialog
      cancelProgressDialog();
      sCircleProgressDialog = new ProgressDialog(activity);
      sCircleProgressDialog.setMessage(msg);
      sCircleProgressDialog.setCancelable(cancelable);
      sCircleProgressDialog.setOwnerActivity(activity);
      sCircleProgressDialog.setOnCancelListener(listener);
    }
  }
  if (!sCircleProgressDialog.isShowing()) {
    sCircleProgressDialog.show();
  }
}

代码示例来源:origin: stackoverflow.com

protected void onPreExecute() {
  pd = new ProgressDialog(app);
  pd.setOwnerActivity(app);
  pd.setTitle("Идет загрузка...");
  pd.setCancelable(true);

代码示例来源:origin: geniusgithub/AndroidDialer

getString(R.string.clearCallLogProgress_title),
    "", true, false);
progressDialog.setOwnerActivity(getActivity());
final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
  @Override

代码示例来源:origin: stackoverflow.com

pd.setOwnerActivity(app);
pd.setTitle("Идет загрузка...");
pd.setCancelable(true);

相关文章