Multiple Intent receivers?

♀尐吖头ヾ 提交于 2019-12-23 12:16:58

问题


Documentation states that if an Intent can be processed by multiple applications the user will be prompted with a dialog asking him to choose the application to complete the action. Is there any way to make user select multiple applications that will complete the action one by one? For example, if I want to share a message I'll be using ACTION_SEND with a specified MIME type and I'll be prompted with a list of applications that can share the message. Can I make a user choose multiple apps to share message on Twitter, Facebook etc. at the same time? Thanks.


回答1:


Is there any way to make user select multiple applications that will complete the action one by one?

Not native to Android.

That being said, there is nothing stopping you from using PackageManager and queryIntentActivities() to create your own chooser that allows multiple selection, then dispatches the event to each checked item one by one.




回答2:


The way OS handles it, seems no. You talk about this, right? Because you load text, and/or image, and then sharing it. Lot of apps can handle it, but every app handles it with different way. May the app who when get text and/or img, do nothing!

e.g G+, asks you what circles you want to share with. facebook i dont know, i dont use it. SMS/MMS: may see if there is a picture or something to choose between them.

Even dropbox sometimes thinks can handle some sharings, but eventually it cant!

Also, there is no option for multiple select in sharing.

If there was, what was going to happen? eg selected g+ and twitter, open first the G+ New post Activity, and when you finish, open the Twitter one?

Maybe using API's for those soc. networks, but user may have to give again its credencials.



来源:https://stackoverflow.com/questions/11376561/multiple-intent-receivers

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