0

要从 Android 音乐应用程序获取 trak 信息,我使用这些 IntentFilter 来启动接收器:

IntentFilter iF = new IntentFilter();
iF.addAction("com.android.music.metachanged");
iF.addAction("com.android.music.playstatechanged");
iF.addAction("com.android.music.playbackcomplete");
iF.addAction("com.android.music.queuechanged");
iF.addAction("com.android.music.metachanged");
iF.addAction("com.miui.player.metachanged");
iF.addAction("com.htc.music.metachanged");
iF.addAction("com.nullsoft.winamp.metachanged");
iF.addAction("com.sec.android.app.music.metachanged");
iF.addAction("com.real.IMP.metachanged");

你认识别人吗?

4

2 回答 2

3

这些是我使用的过滤器:

IntentFilter filter = new IntentFilter();
    filter.addAction("com.android.music.metachanged");
    filter.addAction("com.android.music.playstatechanged");
    filter.addAction("com.android.music.playbackcomplete");
    filter.addAction("com.android.music.queuechanged");

    //HTC Music
    filter.addAction("com.htc.music.playstatechanged");
    filter.addAction("com.htc.music.playbackcomplete");
    filter.addAction("com.htc.music.metachanged");
    //MIUI Player
    filter.addAction("com.miui.player.playstatechanged");
    filter.addAction("com.miui.player.playbackcomplete");
    filter.addAction("com.miui.player.metachanged");
    //Real
    filter.addAction("com.real.IMP.playstatechanged");
    filter.addAction("com.real.IMP.playbackcomplete");
    filter.addAction("com.real.IMP.metachanged");
    //SEMC Music Player
    filter.addAction("com.sonyericsson.music.playbackcontrol.ACTION_TRACK_STARTED");
    filter.addAction("com.sonyericsson.music.playbackcontrol.ACTION_PAUSED");
    filter.addAction("com.sonyericsson.music.TRACK_COMPLETED");
    filter.addAction("com.sonyericsson.music.metachanged");
    filter.addAction("com.sonyericsson.music.playbackcomplete");
    filter.addAction("com.sonyericsson.music.playstatechanged");
    //rdio
    filter.addAction("com.rdio.android.metachanged");
    filter.addAction("com.rdio.android.playstatechanged");
    //Samsung Music Player
    filter.addAction("com.samsung.sec.android.MusicPlayer.playstatechanged");
    filter.addAction("com.samsung.sec.android.MusicPlayer.playbackcomplete");
    filter.addAction("com.samsung.sec.android.MusicPlayer.metachanged");
    filter.addAction("com.sec.android.app.music.playstatechanged");
    filter.addAction("com.sec.android.app.music.playbackcomplete");
    filter.addAction("com.sec.android.app.music.metachanged");
    //Winamp
    filter.addAction("com.nullsoft.winamp.playstatechanged");
    filter.addAction("com.nullsoft.winamp.metachanged");
    //Amazon
    filter.addAction("com.amazon.mp3.playstatechanged");
    filter.addAction("com.amazon.mp3.metachanged");
    //Rhapsody
    filter.addAction("com.rhapsody.playstatechanged");
    //PowerAmp
    filter.addAction("com.maxmpz.audioplayer.playstatechanged");
    //will be added any....
    //scrobblers detect for players (poweramp for example)
    //Last.fm
    filter.addAction("fm.last.android.metachanged");
    filter.addAction("fm.last.android.playbackpaused");
    filter.addAction("fm.last.android.playbackcomplete");
    //A simple last.fm scrobbler
    filter.addAction("com.adam.aslfms.notify.playstatechanged");
    // Others
    filter.addAction("net.jjc1138.android.scrobbler.action.MUSIC_STATUS");
    filter.addAction("com.andrew.apollo.metachanged");

编辑:我发现了这个这个。它们可能有用!:)

于 2016-07-21T15:17:14.307 回答
0

你可以试试这个:

...
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType("uri-to-your-file", "audio/*");
context.startActivity(intent);
于 2012-07-28T16:34:35.060 回答