Share pdf file via my application on android

你离开我真会死。 提交于 2019-12-10 17:35:06

问题


Hi I have to develop an application which should enable sharing of pdf files. I have to create a service wich puts my application as default for .PDF file sharing.

As you can see on the picture I can share the pdf via bluetooth/Gmail/Drive...etc. I need to put there my application to. How can it be done? thanks :)

回答1:


http://www.vogella.com/articles/AndroidIntent/article.html

Go here, then check

4.3. Example: Register an activity for the share intent



回答2:


You need to register it as a reciever for the SEND action. An example is given here. The mime type for pdf is 'application/pdf'.




回答3:


I think you cannot force that, its totally on android system, thats why it pushes for a chooser with all the apps that has registered themselves as handler for specified data type, following which user can mark it as default or not.



来源:https://stackoverflow.com/questions/20653930/share-pdf-file-via-my-application-on-android

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