use the new way of creating temporary files on Android 11+
This commit is contained in:
parent
9da550ecf3
commit
877b9f499a
1 changed files with 5 additions and 1 deletions
|
@ -147,6 +147,10 @@ fun File.createTempFile(): File {
|
|||
return if (isDirectory) {
|
||||
createTempDir("temp", "${System.currentTimeMillis()}", parentFile)
|
||||
} else {
|
||||
createTempFile("temp", "${System.currentTimeMillis()}", parentFile)
|
||||
if (isRPlus()) {
|
||||
kotlin.io.path.createTempFile("temp", "${System.currentTimeMillis()}").toFile()
|
||||
} else {
|
||||
createTempFile("temp", "${System.currentTimeMillis()}", parentFile)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue