Skip to content

Instantly share code, notes, and snippets.

@nazmulidris
Created August 11, 2017 22:05
Show Gist options
  • Save nazmulidris/9ded203b5b195953a80076bd70ed2613 to your computer and use it in GitHub Desktop.
Save nazmulidris/9ded203b5b195953a80076bd70ed2613 to your computer and use it in GitHub Desktop.
if (isPlaying && !mStarted) {
Intent intent = new Intent(mContext, MusicService.class);
ContextCompat.startForegroundService(mContext, intent);
mContext.startForeground(NOTIFICATION_ID, notification);
mStarted = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment