android - How can I start a new activity within a separate process without losing onActivityResult callback?
问题描述
I want to start a new activity in a separate android process by defining it as android:process=":processname"
inside AndroidManifest.xml
. However, I need to return a response to the caller activity. So, I need to start this activity through startActivityForResult(intent, requestCode)
instead of startActivity(intent)
.
However, when I do not add intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
, the new Activity won't start in a new process. When I add this flag, onActivityResult
callback method of the caller Activity is not called. To sum up, my main aim is to separate activities within different processes so that the newly pushed activity should not decrease the performance (FPS value, for instance) of the caller Activity. Besides, the caller one should get a response from the newly pushed activity after it is destroyed which collides with the flag usage.
解决方案
推荐阅读
- java - 如何将 MongoDB 嵌套数组读入本地内存
- python - 使用“用 C 扩展 Python”将二进制数据从 C 传递到 Python
- python - 在 google colab 中使用本地 jupyter 时出现问题
- javascript - 如何检查表列数据类型
- sql - Spark SQL 可以引用上一个窗口/组的第一行吗?
- javascript - 从控制台获取 javascript 输入并存储在数组中,无需换行 \n
- android - 如何使用 Context.getExternalFilesDirs(String)、Context.getExternalCacheDirs() 获取 /storage/emulated/0
- python-3.x - 无法在 Pycharm 中安装 TensorFlow
- c# - 根据属性将列表对象从一个列表复制到另一个列表
- angular - 单击该div内的按钮时如何禁用该div上的matRipple?