From ba262425eb9760969132ea80dcc44cb0faaf1d40 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Apr 2017 20:56:42 +0200 Subject: [PATCH] use the context at media scanning --- .../com/simplemobiletools/commons/extensions/Context-storage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt index 7419cce1e..66e6a073a 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt @@ -182,7 +182,7 @@ fun Context.scanPaths(paths: ArrayList, action: () -> Unit) { fun Context.rescanPaths(paths: ArrayList, 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() })