如何发挥声音默认的播放器? [英] How to play sound in default player?

查看:217
本文介绍了如何发挥声音默认的播放器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用意向code播放声音。我的code完美的作品fine.My设备有两个声音播放器默认的和谷歌播放音乐,这样的问题是每当我尝试播放声音它显示我我要玩的声音,播放器弹出。下面是弹出的图像。

I am playing sound using Intent code. My code works perfectly fine.My device has two sound player the default one and the Google Play Music, so the issue is whenever i try to play a sound it shows me a popup to which player i want to play the sound. Below is an image of the popup.

这是我的code播放声音,

This is my code to play sound,

Uri myUri =Uri.parse("file:/"+selectedFile);
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(myUri, "audio/mp3"); 
startActivity(intent);

我只是想发挥默认的播放器声音没有显示这个弹出。我应该怎么做呢?

I just want to play a sound in default player without showing this popup. what should i do for it ?

推荐答案

您可能要重新考虑,并允许双方球员弹出,因为他们目前做的。所有的用户后,可随时查询默认情况下使用如果她想。

You may want to reconsider and allow both players to popup as they currently do. After all user can always check 'Use by default' if she wants to.

如果你真的只需要谷歌的球员,那么你会发现它的什么包的名字是谷歌源中,明确启动其activitiy。但是,他们可以改变在未来的版本或者它已经为不同的版本不同。更好的你动心,让两者。

If you really need only the Google player then you may find what its package name is within the google sources and start its activitiy explicitly. But they can change that in future releases or maybe it's already different for different releases. Better you reconsider and allow both.

这篇关于如何发挥声音默认的播放器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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