如何从不同的活动得到主要推出的活动意图是什么? [英] How to get Intent of main launch Activity from a different Activity?

查看:101
本文介绍了如何从不同的活动得到主要推出的活动意图是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在不同的活动。我怎样才能让主发射活动​​的意图是什么?

I'm currently in a different Activity. How can I get the main launch Activity's Intent?

Intent launchIntent = getIntent();

在上面,显然 getIntent()不会得到我正确的意图,我需要的。

In the above, obviously getIntent() would not get me the correct Intent that I need.

我怎样才能得到主要推出活动意图

How can I get the main launch Activity's Intent?

推荐答案

活动1 负荷,抢捆绑它的推出有关。

When Activity1 loads, grab the Bundle associated with it's launch.

活性2 启动,把这些相同的演员到新的意图,并将其传递给活性2

When Activity2 is launched, put these same extras into your new Intent, and pass it on to Activity2.

您不能只是访问意图从不同的活动,你需要传递下去的信息。

You can't just access an Intent from a different activity, you need to pass the information along.

这篇关于如何从不同的活动得到主要推出的活动意图是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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