简体   繁体   English

android活动娱乐-意图中是否包含原始附加内容?

[英]android activity recreation- will the intent contain original extras?

I have an activity that expects to be passed a few extras when launched. 我有一项活动,预计将在启动时通过一些额外活动。

When this activity is destroyed and recreated, will the intent returned by getIntent() called from within onCreate() contain the same extras that were present when the activity was originally launched? 销毁并重新创建此活动后,从onCreate()内调用的getIntent()返回的意图是否包含与该活动最初启动时相同的附加功能?

Depends on if it was intentionally destroyed. 取决于它是否被故意破坏。 If it was destroyed by a finish() call, no. 如果它被finish()调用破坏了,否。 If it was destroyed because the system was freeing up memory, yes. 如果由于系统正在释放内存而将其销毁,则可以。 It will also have a flag stating that this is a recreate (useful if your app only works from the first activity, such as an app that needs you to be logged in). 它还将带有一个标志,表明这是重新创建的标志(如果您的应用仅在第一个活动中有效,例如需要您登录的应用,则很有用)。

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

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