当Activity的启动模式是singleInstance时startActivityForResult,onActivityResult没有响应

文档中如是说

if the activity you are launching uses the singleTask launch mode, it will not run in your task and ts you will immediately receive a cancel result. 

也就是无论启动模式设置为singleTask 还是singleInstance,都无法获取到返回值,onActivityResult会收到RESULT_CANCELED

当SecondActivity设置为singleTask 时,任务栈只有一个SecondActivity实例,当返回FirstActivity时,SecondActivity已经被destroyed,不能传值
当SecondActivity设置为singleInstance时,会开启新的任务栈,这2个任务栈无法用这种方式传值

传值的实现方法:

getIntent()

setIntent(Intent)

onResume()

你可能感兴趣的:(当Activity的启动模式是singleInstance时startActivityForResult,onActivityResult没有响应)