谁能告诉我哪个先被调用,是 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(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6468319/
相关文章:
android - Html 列表标签在 android textview 中不起作用。我能做些什么
android - 如何检测Android中布局的方向变化?
android - 在 Android 中删除 SQLite 中的行
android - 如何在 Activity 启动时在 ScrollView 中滚动到底部
android - 为什么一个 Android Studio 项目中有两个 build.gradle
android - 同步 ScrollView 滚动位置 - android
android - 如何使用 HTML 5 创建一个安卓应用程序
android - 是否可以在 xml 描述中旋转可绘制对象?