private void resume ( ) { if ( mIsPaused ) { mIsPaused = false ; mIsPausedAfterAudioFocusChanged = false ; // Try to gain the audio focus before preparing and starting the media player. if ( mAudioManager . requestAudioFocus ( this , AudioManager . STREAM_MUSIC , AudioManager . AUDIOFOCUS_GAIN ) == AudioManager . AUDIOFOCUS_REQUEST_GRANTED ) { mMediaPlayer . start ( ) ; Intent intent = new Intent ( PlaybackListener . ACTION_ON_TRACK_PLAYED ) ; intent . putExtra ( PlaybackListener . EXTRA_KEY_TRACK , mPlayerPlaylist . getCurrentTrack ( ) ) ; mLocalBroadcastManager . sendBroadcast ( intent ) ; updateNotification ( ) ; mMediaSession . setPlaybackState ( MediaSessionWrapper . PLAYBACK_STATE_PLAYING ) ; resumeTimer ( ) ; } } }
Resume the playback .