![android–onActivityResult()&onResume()[复制],第1张 android–onActivityResult()&onResume()[复制],第1张](/aiimages/android%E2%80%93onActivityResult%28%29%26amp%3Bamp%3BonResume%28%29%5B%E5%A4%8D%E5%88%B6%5D.png)
参见英文答案 > 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()[复制]所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)