onActivityResult随着launchMode =" singleTask"? [英] onActivityResult With launchMode="singleTask"?

查看:76
本文介绍了onActivityResult随着launchMode =" singleTask"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您尝试 startActivityForResult 活动,有 launchMode =singleTask;它不会与 onActivityResult 返回任何值,当你设置 launchMode =标准;一切工作正常,但系统的要求说,这活动必须 singleTask ,反正是有解决这个问题?

When you try to startActivityForResult for Activity that has launchMode="singleTask"; it will not return any values with onActivityResult,and when you set launchMode="standard"; everything works fine, but the system requirements says this Activity must be singleTask, is there anyway to solve this?

推荐答案

的<一个该文档href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent,%20int%29"><$c$c>startActivityForResult说:

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

这似乎是没有办法来解决这个问题。

It seems there is no way to get around this.

如果你是被称为活动的开发者,那么你可以把它发送一个广播,当一些结果可用。然后调用活动可以列出这个节目。

If you are the developer of called Activity, then you can have it send a broadcast when some result is available. The calling Activity can then list to this broadcasts.

这篇关于onActivityResult随着launchMode =&QUOT; singleTask&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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