驳回进度对话框在另一个活动...机器人 [英] dismiss Progress Dialog in another Activity ... Android

查看:128
本文介绍了驳回进度对话框在另一个活动...机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有拖活动:

  1. FirstPageActivity
  2. 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:

  1. FirstPageActivity
  2. 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屋!

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