在Android中使用ProgressDialog的小问题 [英] little problem with ProgressDialog in android

查看:76
本文介绍了在Android中使用ProgressDialog的小问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人都好。我在我的项目中使用 ProgressDialog ,但我有一点点!事实上,当我想重定向到其他活动时,我会使用它。但不幸的是,当我回到第一个活动时,它仍然有效!

所以如何在重定向到其他活动后取消对话框?



 ProgressDialog.show( this  正在加载... 请求等待); 
Intent i = new Intent( this ,Content。 class );
i.putExtra( Actype news);
startActivity(i);

解决方案

参考:在加载其他活动时显示ProgressDialog [ ^ ]


您可以使用dismiss函数关闭ProgressDialog。这样的事情:





if(ProgressDialog!= null){

ProgressDialog.dismiss();

}


hi every one . i am using the ProgressDialog in my project , but i have a little with that ! indeed i use it when i want to redirect to other activities . but unfortunately when i come back to the first activity , it still works !
so how can i cancel the dialog after Redirecting to other activities ?!

ProgressDialog.show(this, "Loading ...", " pleas wait");
Intent i=new Intent(this,Content.class); 
i.putExtra("Actype", "news");
startActivity(i);

解决方案

Refer: Show ProgressDialog while other activity is loading[^]


you can close the ProgressDialog with dismiss function. somthing like this:


if(ProgressDialog != null) {
ProgressDialog.dismiss();
}


这篇关于在Android中使用ProgressDialog的小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆