【发布时间】:2015-07-16 05:09:28
【问题描述】:
我有这个创建进度条的代码,但是我没有cancel方法怎么解决这个问题?
void showProgress(String file_path) {
dialog = new Dialog(DownloadFileDemo1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.myprogressdialog);
dialog.setTitle("Download Progress");
TextView text = (TextView) dialog.findViewById(R.id.tv1);
text.setText("Downloading file from ... " + file_path);
cur_val = (TextView) dialog.findViewById(R.id.cur_pg_tv);
cur_val.setText("Starting download...");
dialog.show();
pb = (ProgressBar) dialog.findViewById(R.id.progress_bar);
pb.setProgress(0);
pb.setProgressDrawable(getResources().getDrawable(R.drawable.green_progress));
}
【问题讨论】:
-
听解释如何取消试试这个。 stackoverflow.com/questions/2735102/…
标签: android android-alertdialog progressdialog