注册成为自定义文件类型的默认应用程序 [英] Register to be default app for custom file type

查看:199
本文介绍了注册成为自定义文件类型的默认应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注册才能够打开自定义类型的文件。说我有.cool文件,如果用户试图oepn它,Android的问他们是否愿意与我的应用程序中打开它。怎么样?

Register to be able to open files of custom type. Say i have .cool files, and if the user tries to oepn it, Android asks if they would like to open it with my application. How?

推荐答案

我觉得你没有选择。这是由系统处理。当您发送意图同样的事情由地图来处理,如果有天火的情况下,系统会弹出一个窗口时,你可以选择应用程序,并选择是否希望它永远打开这种文件。
当然,除非你的应用程序是唯一一个打开这种文件。

I think that you don't choose that. This is handle by the system. Same thing when you send an intent to be handled by a map, If you have skyfire for instance, the system pops up a window an you can choose the application and choose if you want it to always open this kind of file.
Unless of course if your application is the only one to open this kind of file.

修改
我想,如果你希望你的应用程序说嘿,我能打开这些.cool文件,你需要设置<意向过滤器> 与标记<数据> 和specificy的MIMETYPE或URI。 检查这里了解更多详情。

Edit
I think if you want your app to say "hey I'm able to open these .cool files", you need to set up <intent-filters> with a tag <data> and specificy the mimeType or Uri. Check here for more details.

这篇关于注册成为自定义文件类型的默认应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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