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

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

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

ProgressDialog.show介绍

暂无

代码示例

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

ProgressDialog progress = new ProgressDialog(this);
progress.setTitle("Loading");
progress.setMessage("Wait while loading...");
progress.setCancelable(false); // disable dismiss by tapping outside of the dialog
progress.show();
// To dismiss the dialog
progress.dismiss();

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

public class MyTask extends AsyncTask<Void, Void, Void> {
 public MyTask(ProgressDialog progress) {
  this.progress = progress;
 }

 public void onPreExecute() {
  progress.show();
 }

 public void doInBackground(Void... unused) {
  ... do your loading here ...
 }

 public void onPostExecute(Void unused) {
  progress.dismiss();
 }
}

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

ProgressDialog mDialog = new ProgressDialog(getApplicationContext());
     mDialog.setMessage("Please wait...");
     mDialog.setCancelable(false);
     mDialog.show();

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

private ProgressDialog pdia;

@Override
protected void onPreExecute(){ 
  super.onPreExecute();
    pdia = new ProgressDialog(yourContext);
    pdia.setMessage("Loading...");
    pdia.show();    
}

@Override
protected void onPostExecute(String result){
  super.onPostExecute(result);
    pdia.dismiss();
}

代码示例来源:origin: guolindev/booksource

/**
 * 显示进度对话框
 */
private void showProgressDialog() {
  if (progressDialog == null) {
    progressDialog = new ProgressDialog(getActivity());
    progressDialog.setMessage("正在加载...");
    progressDialog.setCanceledOnTouchOutside(false);
  }
  progressDialog.show();
}

代码示例来源:origin: crazycodeboy/TakePhoto

/**
   * 显示圆形进度对话框
   *
   * @param activity
   * @param progressTitle 显示的标题
   * @return
   * @author JPH
   * Date 2014-12-12 下午7:04:09
   */
  public static ProgressDialog showProgressDialog(final Activity activity, String... progressTitle) {
    if (activity == null || activity.isFinishing()) {
      return null;
    }
    String title = activity.getResources().getString(R.string.tip_tips);
    if (progressTitle != null && progressTitle.length > 0) {
      title = progressTitle[0];
    }
    ProgressDialog progressDialog = new ProgressDialog(activity);
    progressDialog.setTitle(title);
    progressDialog.setCancelable(false);
    progressDialog.show();
    return progressDialog;
  }
}

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

public class WebViewDemo extends Activity {
 private WebView webView;
 Activity activity ;
 private ProgressDialog progDailog; 
 @SuppressLint("NewApi")
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main);
   activity = this;
   progDailog = ProgressDialog.show(activity, "Loading","Please wait...", true);
   progDailog.setCancelable(false);
   webView = (WebView) findViewById(R.id.webview_compontent);
   webView.getSettings().setJavaScriptEnabled(true);     
   webView.getSettings().setLoadWithOverviewMode(true);
   webView.getSettings().setUseWideViewPort(true);        
   webView.setWebViewClient(new WebViewClient(){
     @Override
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
       progDailog.show();
       view.loadUrl(url);
       return true;                
     }
     @Override
     public void onPageFinished(WebView view, final String url) {
       progDailog.dismiss();
     }
   });
   webView.loadUrl("http://www.teluguoneradio.com/rssHostDescr.php?hostId=147");
   }

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

ProgressDialog pd = new ProgressDialog(yourActivity.this);
pd.setMessage("loading");
pd.show();

代码示例来源:origin: iMeiji/Toutiao

holder.tv_video_time.setText(tv_video_time);
final ProgressDialog dialog = new ProgressDialog(context);
dialog.setTitle(R.string.loading);
RxView.clicks(holder.itemView)
    .throttleFirst(1300, TimeUnit.MILLISECONDS)
    .doOnNext(o -> dialog.show())
    .observeOn(Schedulers.io())
    .switchMap((Function<Object, ObservableSource<String>>) o -> {
    })
    .subscribe(dataBean -> {
      dialog.dismiss();
      VideoContentActivity.launch(dataBean);
    }, throwable -> {
      dialog.dismiss();
      ErrorAction.print(throwable);
    });

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

ProgressDialog mProgressDialog = new ProgressDialog(Your_Activity.this);
mProgressDialog.setMessage("Here you can set a message");
mProgressDialog.setIndeterminate(false);
mProgressDialog.setMax(100);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.show();
MyAsyncTask obj = new MyAsyncTask ();
obj.execute("url");

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

public static ProgressDialog createProgressDialog(Context mContext) {
     ProgressDialog dialog = new ProgressDialog(mContext);
     try {
         dialog.show();
     } catch (BadTokenException e) {
     }
     dialog.setCancelable(false);
     dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
     dialog.setContentView(R.layout.progressdialog);
     // dialog.setMessage(Message);
     return dialog;
 }

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

ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Thinking...");
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.show();

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

protected void onPreExecute()
  Dialog.setMessage("Doing something...");
  Dialog.show();
  Dialog.dismiss();

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

@SuppressLint("NewApi")
public static void showHorizontalProgressDialog(Activity context, String msg, boolean isShowSize) {
  cancel();
  if (sHorizontalProgressDialog == null) {
    sHorizontalProgressDialog = new ProgressDialog(context);
    sHorizontalProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    sHorizontalProgressDialog.setCanceledOnTouchOutside(false);
    if (isShowSize)
      sHorizontalProgressDialog.setProgressNumberFormat("%2dMB/%1dMB");
  }
  if (!TextUtils.isEmpty(msg)) {
    sHorizontalProgressDialog.setMessage(msg);
  }
  sHorizontalProgressDialog.show();
}

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

ProgressDialog mDialog = new ProgressDialog(getApplicationContext());
       mDialog.setMessage("Loading...");
       mDialog.setCancelable(false);
       mDialog.show();

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

public void onPageStarted(WebView view, String url, Bitmap favicon)
  pd.show();
   pd.dismiss();

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

@SuppressWarnings("deprecation") // ProgressDialog change tracked in github as #5020
protected void translate() {
  if(!Connection.isOnline()) {
    showToast(gtxt(R.string.network_no_connection));
    return;
  }
  progressDialog = android.app.ProgressDialog.show(this, getText(R.string.multimedia_editor_progress_wait_title),
      getText(R.string.multimedia_editor_trans_translating_online), true, false);
  progressDialog.setCancelable(true);
  progressDialog.setOnCancelListener(this);
  mWebServiceAddress = computeAddress();
  try {
    mTranslationLoadPost = new BackgroundPost();
    mTranslationLoadPost.execute();
  } catch (Exception e) {
    progressDialog.dismiss();
    showToast(getText(R.string.multimedia_editor_something_wrong));
  }
}

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

class MyAsyncTask extends AsyncTask<String, String, Void> {
 private ProgressDialog progressDialog = new ProgressDialog(MainActivity.this);
 InputStream inputStream = null;
 String result = ""; 
 protected void onPreExecute() {
   progressDialog.setMessage("Downloading your data...");
   progressDialog.show();
   progressDialog.setOnCancelListener(new OnCancelListener() {
     public void onCancel(DialogInterface arg0) {
       MyAsyncTask.this.cancel(true);
     }
   });
 }

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

progressDialog.setMessage("Fetching route, Please wait...");
progressDialog.setIndeterminate(true);
progressDialog.show();

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

progressDialog = gimmeOne(ctx);
progressDialog.setCancelable(true);
progressDialog.setOnCancelListener(new OnCancelListener() {
  @Override
progressDialog.show();

相关文章