mirror of
https://github.com/Michatec/Radio.git
synced 2026-04-01 07:56:27 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* DownloadFinishedReceiver.kt
|
||||
* Implements the DownloadFinishedReceiver class
|
||||
* A DownloadFinishedReceiver listens for finished downloads
|
||||
*
|
||||
* This file is part of
|
||||
* TRANSISTOR - Radio App for Android
|
||||
*
|
||||
* Copyright (c) 2015-22 - Y20K.org
|
||||
* Licensed under the MIT-License
|
||||
* http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
|
||||
package com.michatec.radio.helpers
|
||||
|
||||
import android.app.DownloadManager
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
||||
|
||||
/*
|
||||
* DownloadFinishedReceiver class
|
||||
*/
|
||||
class DownloadFinishedReceiver : BroadcastReceiver() {
|
||||
|
||||
/* Overrides onReceive */
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
// process the finished download
|
||||
DownloadHelper.processDownload(
|
||||
context,
|
||||
intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1L)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user