android–onActivityResult()&onResume()[复制]

android–onActivityResult()&onResume()[复制],第1张

概述参见英文答案>IsonResume()calledbeforeonActivityResult()?                                    3个有人能告诉我哪个首先被调用,是onActivityResult()还是onResume()?例:ActivityA调用startActivityForResult()来启动ActivityB.B

参见英文答案 > Is onResume() called before onActivityResult()?                                    3个
有人能告诉我哪个首先被调用,是onActivityResult()还是onResume()?
例:

Activity A调用startActivityForResult()来启动Activity B. B执行,完成并将结果返回给A,但首先调用A的哪个方法,onActivityResult()或onResume()?

我知道有人已经通过参考Activity Docs回答了这个问题,但我自己找不到.

解决方法:

首先调用onActivityResult()然后调用onResume().

从文档引用:

protected voID onActivityResult (int
requestCode, int resultCode, Intent
data)

Since: API Level 1 Called when an
activity you launched exits, giving
you the requestCode you started it
with, the resultCode it returned, and
any additional data from it. The
resultCode will be RESulT_CANCELED if
the activity explicitly returned that,
dIDn’t return any result, or crashed
during its operation. You will receive
this call immediately before
onResume() when your activity is
re-starting.

总结

以上是内存溢出为你收集整理的android – onActivityResult()&onResume()[复制]全部内容,希望文章能够帮你解决android – onActivityResult()&onResume()[复制]所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1102086.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存