Yes, Sorry !
Here it is:
RemoteControlClient mRemoteControlClient = null;
protected void onCreate(Bundle savedInstanceState) {
...
PendingIntent pi = PendingIntent.getBroadcast(getApplicationContext(), 0, i, 0);
mRemoteControlClient = new RemoteControlClient(pi);
mAudioManager.registerRemoteControlClient(mRemoteControlClient);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP
| RemoteControlClient.FLAG_KEY_MEDIA_FAST_FORWARD
| RemoteControlClient.FLAG_KEY_MEDIA_REWIND;
mRemoteControlClient.setTransportControlFlags(flags);
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
...
}
private void notifyChange()
{
Thread meta = new Thread(new Runnable()
{
public void run()
{
mRemoteControlClient
.editMetadata(true)
.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, Get_Station())
.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, Get_Comment())
.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, 3000)
.apply();
}
});
meta.start();
try {
meta.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}