简体   繁体   English

启动新活动后,先前的活动是否有可能继续通过意图将数据发送到新活动?

[英]Is it possible that after launching new activity the previous activity keeps sending data to new activity via intent?

I am working on an app in which i'm sending data to another activity via intent . 我正在开发一个应用程序,其中我通过intent将数据发送到另一个活动。 is it possible that after launch of new activity data transfer (updates) continue to receive by new activity? 启动新活动后,新活动是否可能继续接收数据传输(更新)? links would be appreciated thanks in advance. 链接将不胜感激在此先感谢。

If another activity is loaded, then the previous one goes on the onPause state. 如果加载了另一个活动,则前一个活动将处于onPause状态。 It wouldn't be accurate expecting anything from a paused activity. 从暂停的活动中得到任何期望都是不准确的。

Depending on the case and the function of the second activity, you could either use a service, or depending on your case, you might also be able to use fragments and stick with one activity. 根据情况和第二项活动的功能,您可以使用服务,也可以根据情况,使用片段并坚持一项活动。

An example of your code would be helpful to understand the case. 您的代码示例将有助于理解这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM