ProgressDialog在TabHost应用ofandroidProgressDialog、TabHost、ofandroid

2023-09-03 21:05:13 作者:那抹嶶笶ゐ何侞茈淒涼

我要使用的进度Dailog在我的应用程序。我在做它面临一个问题,有些RND后,我才知道,这是不太可能创造进度对话框我的活动组级的TabHost应用程序中。

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.

我有完全一样的情况下,我有TabHost在我的应用程序和的ActivityGroup类具有TabHost类。所以,当我尝试创建进度对话框的类是在活动组类,我不能创建它。但是,如果我尝试创建进度对话框的类不在活动组,我可以没有问题创造它。

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?

推荐答案

我认为这个问题是与进度对话框的情况下

I think the problem is with context of the progress dialog

先给对话的上下文中的getParent()

Try giving the context of the dialog as getParent()

ProgressDialog.show(的getParent(),载入中...,请稍候...,真,假);

ProgressDialog.show(getParent(), " Loading...", "Please wait...", true, false);