mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
add a check for writing to SD card for Android 5+
This commit is contained in:
@ -5,6 +5,7 @@ import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.support.v4.content.ContextCompat
|
||||
import android.widget.Toast
|
||||
import com.simplemobiletools.filepicker.extensions.getSDCardPath
|
||||
import java.util.regex.Pattern
|
||||
|
||||
object Utils {
|
||||
@ -29,4 +30,8 @@ object Utils {
|
||||
val matcher = pattern.matcher(name)
|
||||
return matcher.matches()
|
||||
}
|
||||
|
||||
fun isPathOnSD(context: Context, path: String): Boolean {
|
||||
return path.startsWith(context.getSDCardPath())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user