android的TabHost应用程序中的ProgressDialog
我想在我的应用程序中使用进度对话框。我在执行此操作时遇到一个问题,经过一番研究后,我发现不太可能创建进度对话框,我在应用程序中具有 TabHost 的活动组类。
我有完全相同的场景,我的应用程序中有 TabHost 以及具有 TabHost 类的 ActivityGroup 类。因此,当我尝试为活动组类中的类创建进度对话框时,我无法创建它。但是,如果我尝试为不在活动组中的类创建进度对话框,我可以毫无问题地创建它。
现在有什么解决办法吗?
I want to use the Progress Dailog in my application. I am facing one issue in doing it, after some RnD I came to know that it is not quite possible to create the progress Dialog I have the Activity Group Class for the TabHost in the application.
I have exactly the same scenario, I have the TabHost in my application and an ActivityGroup Class that has the TabHost Classes. So, when I try to create the Progress Dialog for the Class that is in the Activity Group Class I cannot create it. But if I try to create the Progress Dialog for the Class that is not in the Activity Group I can create it with no issues.
Is there any solutions now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题出在进度对话框的上下文上
尝试将对话框的上下文指定为 getParent()
ProgressDialog.show(getParent(), " Loading...", "Please wait...", true, false);
I think the problem is with context of the progress dialog
Try giving the context of the dialog as getParent()
ProgressDialog.show(getParent(), " Loading...", "Please wait...", true, false);