简体   繁体   English

Android文件协会

[英]Android File Association

How do I have a new file type launch my app? 如何使用新文件类型启动我的应用程序?

For example if I have a new file type 'file.mjl' and I receive this file as an email, I want Android to associate this file type with my app and allow me to open / save it. 例如,如果我有一个新文件类型'file.mjl'并且我将此文件作为电子邮件收到,我希望Android将此文件类型与我的应用程序相关联,并允许我打开/保存它。

You need to add an intent-filter to the activity you want to launch to work with that file. 您需要向要启动的活动添加intent-filter以使用该文件。 Here is a link to a great example on that subject: 这是一个关于该主题的一个很好的例子的链接:

https://developer.android.com/guide/topics/intents/intents-filters.html https://developer.android.com/guide/topics/intents/intents-filters.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM