use the context at media scanning

This commit is contained in:
tibbi 2017-04-17 20:56:42 +02:00
parent f73e109a25
commit ba262425eb

View file

@ -182,7 +182,7 @@ fun Context.scanPaths(paths: ArrayList<String>, action: () -> Unit) {
fun Context.rescanPaths(paths: ArrayList<String>, action: () -> Unit) {
var cnt = paths.size
MediaScannerConnection.scanFile(this, paths.toTypedArray(), null, { s, uri ->
MediaScannerConnection.scanFile(applicationContext, paths.toTypedArray(), null, { s, uri ->
if (--cnt == 0)
action.invoke()
})