List of usage examples for android.media RemoteControlClient setTransportControlFlags
public void setTransportControlFlags(int transportControlFlags)
From source file:net.nightwhistler.pageturner.fragment.ReadingFragment.java
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void registerRemoteControlClient(ComponentName componentName) { audioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); Intent remoteControlIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); remoteControlIntent.setComponent(componentName); RemoteControlClient localRemoteControlClient = new RemoteControlClient( PendingIntent.getBroadcast(context, 0, remoteControlIntent, 0)); localRemoteControlClient.setTransportControlFlags(RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE | RemoteControlClient.FLAG_KEY_MEDIA_NEXT | RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS | RemoteControlClient.FLAG_KEY_MEDIA_PLAY | RemoteControlClient.FLAG_KEY_MEDIA_PAUSE); audioManager.registerRemoteControlClient(localRemoteControlClient); this.remoteControlClient = localRemoteControlClient; }