当前位置:操作系统 > 安卓/Android >>

android : ProgressDialog 进度条的快捷使用

private ProgressDialog myProgressDialog = null;//进度条
//显示进度提示
public void showProgress(String title, String msg) {
try {
if (myProgressDialog != null) {
myProgressDialog.cancel();
}
myProgressDialog = ProgressDialog.show(this, title, msg);
myProgressDialog.setCancelable(false);
} catch (Exception e) {
} finally {
}
}
  
//取消进度提示
public void cancelProgress(){
try {
if (myProgressDialog!=null) {
myProgressDialog.dismiss();
myProgressDialog.cancel();
}
} catch (Exception e) {
} finally {
}
}
 
补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,