如何暂停和播放android本机音乐播放器
我将从我的应用程序中播放一些通知警报。。此时,系统应暂停设备中运行的音乐。为此,我将发送广播事件以暂停媒体如何暂停和播放android本机音乐播放器,android,Android,我将从我的应用程序中播放一些通知警报。。此时,系统应暂停设备中运行的音乐。为此,我将发送广播事件以暂停媒体 Intent audioIntent = new Intent("com.android.music.musicservicecommand.pause"); MYActivity.sendBroadcast(audioIntent); 此代码仅用于暂停Google Play Music和默认音乐播放器。。但这段代码不适用于Poweramp和VLC。。请发布您的解决方案。
Intent audioIntent = new Intent("com.android.music.musicservicecommand.pause");
MYActivity.sendBroadcast(audioIntent);
此代码仅用于暂停Google Play Music和默认音乐播放器。。但这段代码不适用于Poweramp和VLC。。请发布您的解决方案。请将评论发布给那些贬低我问题的人…我只使用了这些行。。。该行仅适用于默认玩家。不是功率放大器或vlc。。检查更多时间。。。
You really should supply the code you have written for the broadcast, this is a very hard question to answer without your code... Something like this is what most people use:
Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
YourApplicationClass.this.sendBroadcast(i);