澄清的Andr​​oid活动的生命周期 [英] Clarification on Android Activity Lifecycle

查看:130
本文介绍了澄清的Andr​​oid活动的生命周期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能澄清 - 如果我的活动,我离开通过startActivityForResult调用的意图(如拍照),当用户回到我的应用程序,什么是入口点的活动?是的onCreate,在onStart或者onResume?

Can someone clarify - if in my activity, I leave to call an intent via startActivityForResult (such as take a picture), when users return to my app, what is the entry point for that activity? Is it onCreate, onStart, or onResume?

谢谢!

推荐答案

如果原来的活动从未停止过,它通过onResume重新进入()。如果停止了通过onRestart()重新进入 - >在onStart() - > onResume()

If the original activity is never stopped, it reenters via onResume(). If it is stopped it reenters via onRestart() -> onStart() -> onResume().

startActivityForResult不应该停止原来的活动。

startActivityForResult shouldn't stop the original activity.

这篇关于澄清的Andr​​oid活动的生命周期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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