This commit is contained in:
tom5079
2020-09-10 21:41:57 +09:00
parent 62eb28ac01
commit 6e2eeb29cc
8 changed files with 10 additions and 14 deletions

View File

@@ -381,6 +381,8 @@ class DownloadService : Service() {
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
startForeground(R.id.downloader_notification_id, serviceNotification.build())
when (intent?.getStringExtra(KEY_COMMAND)) {
COMMAND_DOWNLOAD -> intent.getIntExtra(KEY_ID, -1).let { if (it > 0)
download(it, intent.getBooleanExtra(KEY_PRIORITY, false), startId)