如何使一个意图过滤器播放MP3文件? [英] How do I make an intent-filter for playing an MP3 file?

查看:115
本文介绍了如何使一个意图过滤器播放MP3文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了Android的音乐播放器应用程序。现在,在选择手机的文件管理器中的音乐文件的时候,我想我的应用程序,以显示为使用完整的行动在弹出的选项之一。我的想法是要做到这一点使用意图过滤器,但我不知道我需要什么样的行动,类别或数据提供给它。如何创建一个意图过滤器呢?

I have created a music player application in Android. Now, when selecting a music file in the phone's file manager, I want my application to appear as one of the options in the "Complete action using" popup. My idea is to do this using intent filter but I have no idea what action, category, or data I need to supply to it. How do I create an intent filter for this?

我也看到了相关的问题在这里:如何使一个意图过滤器用于流的MP3文件但我的是不是流,我只是播放音乐文件。

I've also seen a related question here: How do I make an intent-filter for streaming an MP3 file? but mine is not streaming, i am just playing music from file.

感谢你在前进。

推荐答案

希望这意图过滤器可以帮助你。

Hope this Intent Filter can help you

<intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="content"/>
        <data android:scheme="file"/>
        <data android:mimeType="audio/*"/>
    </intent-filter>

这篇关于如何使一个意图过滤器播放MP3文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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