驳回进度对话框在另一个活动...机器人 [英] dismiss Progress Dialog in another Activity ... Android
问题描述
我有拖活动:
-
FirstPageActivity
-
SecondPageActivity
应用程序调用 SecondPageActivity
的 FirstPageActivity
...
和App发送的Htt prequest
在 SecondPageActivity
。
所以,我想告诉进度对话框中的 FirstPageActivity
并在 SecondPageActivity
完成下载数据,它辞退进度,然后Appear.Is这可能吗?
我要显示进度对话框中FirstPageActivity和之后的SecondPageActivity完成下载数据,它关闭该进程,然后Appear.Is这可能吗?
没有。
您不能处理一个活动的
UI功能或从其他'活动的任何功能。
如果您启动 ProggressDailog
在 FirstPageActivity
那么你一定要关闭它在的onPause ()
继续到其他活动之前
如你所说 SecondPageActivity
。
您可以开始一个新的 ProggressDailog
在 SecondPageActivity
从的onCreate()
或 onResume()
方法。
更新:
从 ProggressDailog的文档你可以看到,初始化 ProggressDialog
它需要通过电流活动
上下文。
ProgressDialog(上下文的背景下)
ProgressDialog(上下文的背景下,诠释主题)
I have Tow Activities:
FirstPageActivity
SecondPageActivity
The App call the SecondPageActivity
by the FirstPageActivity
...
and the App send HttpRequest
In the SecondPageActivity
.
So I want to show Progress Dialog in the FirstPageActivity
and After the SecondPageActivity
Finish downloading the data, it Dismiss the Progress and then Appear.Is that Possible ?
I want to show Progress Dialog in the FirstPageActivity and After the SecondPageActivity Finish downloading the data, it Dismiss the Progress and then Appear.Is that Possible ?
No.
You can't handle one Activity's
UI functionality or any functionality from another `Activity.
If you start a ProggressDailog
in FirstPageActivity
then you must be dismiss it in onPause()
before proceeding to other Activity
as you said SecondPageActivity
.
You can start a new ProggressDailog
in SecondPageActivity
from onCreate()
or onResume()
method.
Update:
From the document of ProggressDailog you can see, to initialize a ProggressDialog
its need to pass the current Activity
context.
ProgressDialog(Context context)
ProgressDialog(Context context, int theme)
这篇关于驳回进度对话框在另一个活动...机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!