Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting the details of the current song playing in the media player in Android
    primarykey
    data
    text
    <p>I'm currently using a method similar to the one below to retrieve the information, however I am not sure how I can obtain the genre. Does anyone know what the string extra is called for genre or if there is an extra at all? Thanks.</p> <p><a href="https://stackoverflow.com/questions/10510292/how-to-get-current-music-track-info">Track info of currently playing music</a></p> <pre><code>public class CurrentMusicTrackInfoActivity extends Activity { public static final String SERVICECMD = "com.android.music.musicservicecommand"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); com.sec.android.app.music.player.service.CorePlayerService 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"); registerReceiver(mReceiver, iF); } private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); String cmd = intent.getStringExtra("command"); Log.v("tag ", action + " / " + cmd); String artist = intent.getStringExtra("artist"); String album = intent.getStringExtra("album"); String track = intent.getStringExtra("track"); Log.v("tag",artist+":"+album+":"+track); Toast.makeText(CurrentMusicTrackInfoActivity.this,track,Toast.LENGTH_SHORT).show(); } }; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload