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

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

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

ProgressDialog.isShowing介绍

暂无

代码示例

代码示例来源:origin: Justson/AgentWeb

@Override
public void onCancelLoading() {
  if (mProgressDialog != null && mProgressDialog.isShowing()) {
    mProgressDialog.dismiss();
  }
  mProgressDialog = null;
}

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

public void getMovies() {

   ProgressDialog mProgressDialog = new ProgressDialog(this);
   mProgressDialog.setIndeterminate(true);
   mProgressDialog.setMessage("Loading...");
   mProgressDialog.show();
   MovieClient.getWeather().movies(MovieClient.getRandomMovie(), new Callback<MovieRequest>() {
   @Override
   public void success(MovieRequest movieRequest, Response response) {

     Picasso.with(getApplicationContext()).load(movieRequest.getPoster()).into(image);

     if (mProgressDialog.isShowing())
      mProgressDialog.dismiss();

  }

   @Override
   public void failure(RetrofitError error) {
     if (mProgressDialog.isShowing())
      mProgressDialog.dismiss();

     Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();

   }
  });
}

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

final Activity activity = this;

final ProgressDialog progressDialog = new ProgressDialog(activity);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false);

browser.setWebChromeClient(new WebChromeClient() {
  public void onProgressChanged(WebView view, int progress) {
    progressDialog.show();
    progressDialog.setProgress(0);
    activity.setProgress(progress * 1000);

    progressDialog.incrementProgressBy(progress);

    if(progress == 100 && progressDialog.isShowing())
      progressDialog.dismiss();
  }
});

代码示例来源:origin: chat-sdk/chat-sdk-android

protected void showProgressDialog(String message) {
  if (progressDialog == null) {
    progressDialog = new ProgressDialog(this);
  }
  if (!progressDialog.isShowing()) {
    progressDialog = new ProgressDialog(this);
    progressDialog.setMessage(message);
    progressDialog.show();
  }
}

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

private ProgressDialog pDialogTh = null;
   private void showLoading()
   {
           // if(pDialog==null)
           pDialogTh = ProgressDialog.show(mContext, "", "Loading...",
               true, true);
           pDialogTh.setCancelable(false);
           if (!pDialogTh.isShowing()) {
             pDialogTh.show();
           }
    }

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

if( (myProgressDialog!= null) && myProgressDialog.isShowing()){
  myProgressDialog.dismiss();
myProgressDialog.setCancelable(true);

代码示例来源:origin: yayaa/LocationManager

@Override
public void updateProgress(String text) {
  if (progressDialog != null && progressDialog.isShowing()) {
    progressDialog.setMessage(text);
  }
}

代码示例来源:origin: TommyLemon/APIJSON

@Override
  public void run() {
    if (progressDialog == null) {
      progressDialog = new ProgressDialog(context);
    }
    if(progressDialog.isShowing() == true) {
      progressDialog.dismiss();
    }
    if (dialogTitle != null && ! "".equals(dialogTitle.trim())) {
      progressDialog.setTitle(dialogTitle);
    }
    if (dialogMessage != null && ! "".equals(dialogMessage.trim())) {
      progressDialog.setMessage(dialogMessage);
    }
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();
  }
});

代码示例来源:origin: chat-sdk/chat-sdk-android

protected void showOrUpdateProgressDialog(String message) {
  if (progressDialog == null) {
    progressDialog = new ProgressDialog(this);
  }
  if (!progressDialog.isShowing()) {
    progressDialog = new ProgressDialog(this);
    progressDialog.setMessage(message);
    progressDialog.show();
  } else progressDialog.setMessage(message);
}

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

private ProgressDialog pDialogTh = null;
  private void showLoading() {
   runOnUiThread(new Runnable() {
     public void run() {
       // if(pDialog==null)
       pDialogTh = ProgressDialog.show(YourActivity.this, "", "Loading...",
           true, true);
       pDialogTh.setCancelable(false);
       if (!pDialogTh.isShowing()) {
         pDialogTh.show();
       }
     }
   });
 }

代码示例来源:origin: ankidroid/Anki-Android

private void dismissCarefullyProgressDialog() {
  try {
    if ((progressDialog != null) && progressDialog.isShowing()) {
        progressDialog.dismiss();
    }
  } catch (Exception e) {
    // nothing is done intentionally
  }
}

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

ProgressDialog progressdialog = new ProgressDialog(getActivity());
progressdialog.show();
if(progressdialog.isShowing())
{
progressdialog.dismiss();
}

代码示例来源:origin: yayaa/LocationManager

@Override
public void updateProgress(String text) {
  if (progressDialog != null && progressDialog.isShowing()) {
    progressDialog.setMessage(text);
  }
}

代码示例来源:origin: TommyLemon/Android-ZBLibrary

@Override
  public void run() {
    if (progressDialog == null) {
      progressDialog = new ProgressDialog(context);
    }
    if(progressDialog.isShowing() == true) {
      progressDialog.dismiss();
    }
    if (dialogTitle != null && ! "".equals(dialogTitle.trim())) {
      progressDialog.setTitle(dialogTitle);
    }
    if (dialogMessage != null && ! "".equals(dialogMessage.trim())) {
      progressDialog.setMessage(dialogMessage);
    }
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();
  }
});

代码示例来源:origin: chat-sdk/chat-sdk-android

protected void showOrUpdateProgressDialog(String message) {
  if (progressDialog == null)
    progressDialog = new ProgressDialog(getActivity());
  if (!progressDialog.isShowing())
  {
    progressDialog = new ProgressDialog(getActivity());
    progressDialog.setMessage(message);
    progressDialog.show();
  }
  else {
    progressDialog.setMessage(message);
  }
}

代码示例来源:origin: javaexception/MVP_Retrofit_RxJava_Example

private void initProgressDialog(){
  if (pd == null) {
    pd = new ProgressDialog(context);
    pd.setCancelable(cancelable);
    if (cancelable) {
      pd.setOnCancelListener(new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
          mProgressCancelListener.onCancelProgress();
        }
      });
    }
    if (!pd.isShowing()) {
      pd.show();
    }
  }
}

代码示例来源:origin: TommyLemon/APIJSON

@Override
  public void run() {
    if (progressDialog != null && progressDialog.isShowing()) {
      progressDialog.dismiss();
    }
    if (pbBaseTitle != null) {
      pbBaseTitle.setVisibility(View.GONE);
    }
  }
});

代码示例来源:origin: hiteshbpatel/Android_Blog_Projects

/**
 * 
 */
public void onInitiateDiscovery() {
  if (progressDialog != null && progressDialog.isShowing()) {
    progressDialog.dismiss();
  }
  progressDialog = ProgressDialog.show(getActivity(), "Press back to cancel", "finding peers", true,
      true, new DialogInterface.OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
          
        }
      });
}

代码示例来源:origin: yayaa/LocationManager

@Override
public void updateProgress(String text) {
  if (progressDialog != null && progressDialog.isShowing()) {
    progressDialog.setMessage(text);
  }
}

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

private ProgressDialog dialog = new ProgressDialog(WebActivity.this);

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.webview);
  webView = (WebView) findViewById(R.id.webView1);

  Bundle extras = getIntent().getExtras();
  String url=extras.getString("adres");

  webView.setWebViewClient(new WebViewClient() {
    @Override
    public void onPageFinished(WebView view, String url) {                  
      if (dialog.isShowing()) {
        dialog.dismiss();
      }
    }
  });
  dialog.setMessage("Loading..Please wait.");
  dialog.setCanceledOnTouchOutside(false);
  dialog.show();
  webView.loadUrl(url);


  WebSettings webSettings = webView.getSettings();
  webSettings.setJavaScriptEnabled(true);
}

相关文章