Intent.createChooser: How we can check sharing image intent count?

旧时模样 提交于 2019-12-02 14:10:15

问题


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.)

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/requestCode: 100 E/resultOk: -1 E/resultCancel: 0


回答1:


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

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.




回答2:


In case of default Android intent sharing we can not get the acknowledgement whether the item is shared or not, the Intent sharing dialog is managed by Android OS itself and sharing in particular app is managed by that app so it is not in our app's control.

If we are sharing images from our application then we can defiantly get the count of selected images to share.



来源:https://stackoverflow.com/questions/42022772/intent-createchooser-how-we-can-check-sharing-image-intent-count

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!