Intent.createChooser:如何检查共享图像的意图计数? [英] Intent.createChooser: How we can check sharing image intent count?

查看:72
本文介绍了Intent.createChooser:如何检查共享图像的意图计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)我们如何检查android共享意图选择了哪个应用程序?我们如何知道图像共享成功与否?
是否可以确认Android中的共享意图是成功还是失败? (例如,如果我共享一个环聊信息,我想知道它是否已成功发布或是否已取消。)

1) How we can check which app was selected by an android sharing intent?And how can we know the image shared successfully or not? Is there a way to confirm if a Share intent in Android was successful or unsuccessful? (For example, if I share a hangout post, I'd like to know if it was successfully posted or know if it was cancelled.)

我尝试了 onActivityResult ,但是当我单击共享按钮时,接下来我单击了 outSideTouchListener (在选择图像时以及单击时

i have tried out with onActivityResult but when i clicked on share button then next i clicked on outSideTouchListener (when am selecting an image and when i clicked on outside same output is coming.)

Logcat:

E / resultCode: 0
E /请求代码:100
E /结果确定:-1
E /结果取消:0

推荐答案


我们如何检查android共享意图选择了哪个应用程序?

How we can check which app was selected by an android sharing intent?

在Android 5.1及更高版本上,您可以使用 createChooser()的三参数版本 。否则,除非您创建自己的选择器,否则无法确定。

On Android 5.1 and higher, you can find out the chosen activity by using the three-parameter version of createChooser(). Otherwise, you cannot determine this, unless you create your own chooser.


我们如何知道图像是否成功共享?

And how can we know the image shared successfully or not?

您不能。没有成功的通用定义,共享内容的发生取决于用户和用户选择的应用程序,而不是您自己。

You can't. There is no universal definition of "successfully", and what happens with the shared content is up to the user and the app that the user chose, not you.

这篇关于Intent.createChooser:如何检查共享图像的意图计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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