Created
September 7, 2020 06:12
-
-
Save fredchung/10c1040e08a4e5fcbb5e73e0b13814e3 to your computer and use it in GitHub Desktop.
Setting foreground service types in WorkManager long-running workers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setForeground( | |
ForegroundInfo(NOTIF_ID, | |
notification.build(), | |
// Foreground service types. | |
ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION or ...) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment