Code example for RemoteControlClient

Methods: setPlaybackState

0
			audioManager.unregisterRemoteControlClient(mRemoteControl);
		} 
	} 
	 
	public void setPlaybackState(final int state) {
		mRemoteControl.setPlaybackState(state);
	} 
	 
	public void updateMetadata(final Context context, final MusicDirectory.Entry currentSong) {
		if(imageLoader == null) {
			imageLoader = SubsonicTabActivity.getStaticImageLoader(context);
		} 
		 
		// Update the remote controls 
    	mRemoteControl.editMetadata(true)
    	.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, (currentSong == null) ? null : currentSong.getArtist())
    	.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, (currentSong == null) ? null : currentSong.getArtist())
    	.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, (currentSong) == null ? null : currentSong.getTitle())
    	.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, (currentSong == null) ? 
    			0 : ((currentSong.getDuration() == null) ? 0 : currentSong.getDuration()))
    	.apply();