我试图让Android浏览器下载一个特定类型的.XXX'说,这样我就可以设置一个应用程序来与它相关的文件。
I'm trying to make the android browser download a file of a specific type '.xxx’ say, so that I can then set an app to be associated with it.
我已经成功地完成了协会的一部分,在这样点击右边类型在资源管理器应用程序的文件加载相应的应用程序,我已经做到了。我预计今年结转到浏览器,这样,如果我试图下载一个文件类型.XXX那么它会打开应用程序。
I've successfully done the association part, in that I've made it so that clicking on a file of the right type in an explorer app loads the appropriate app. I expected this to carry over to the browser so that if I attempted to download a file type .xxx then it would open the app.
这不会发生,发生的事情是,文件中包含的文本显示在浏览器中。我已经成立了天文(应用/ XXXX)MIME类型链接,该但这要么没有什么区别。它必须能够做我想做的,因为如果我点击比如浏览器下载它,并给我开了PDF阅读器的选项。一个PDF文件
This doesn’t happen, all that happens is that the text contained in the file is displayed in the browser. I've set up a mime type link for this in astro (application/xxxx) but this has made no difference either. It must be possible to do what I want because If I click on a pdf file for instance the browser downloads it and gives me the option to open a pdf reader.
推荐答案
您需要添加一个<意向滤光器>
中的标签 <接收器GT;
在你的应用程序清单标签
You need to add an <intent-filter>
tag within a <receiver>
tag in your Application Manifest.
这是如何工作如下:
Android的广播意图
Android broadcasts an intent
该系统的搜索能够接收这一意图的应用程序列表
The system searches a list of applications capable of receiving that intent
该系统查询用户选择一个应用程序来处理的意图
The system queries the user to select an application to handle that intent
用户选择一个应用程序,或者被默认为pre-指定的应用程序
The user selects an application, or is defaulted to a pre-specified application
应用程序打开
看看的接收元件,文档看有关如何实现这更多的细节。
Take a look at the receiver element docs to see more details about how to implement this.
奥莱如果你需要更多的帮助。
Holler if you need more help.
感谢
相关推荐
最新文章