simplify filename fetching from path

This commit is contained in:
tibbi 2020-03-31 10:28:33 +02:00
parent f1bb2e1656
commit 79cf72bf6c

View file

@ -79,7 +79,7 @@ class RecorderService : Service() {
try {
if (!isQPlus() && isPathOnSD(currFilePath)) {
var document = getDocumentFile(currFilePath.getParentPath())
document = document?.createFile("", currFilePath.substring(currFilePath.lastIndexOf('/') + 1))
document = document?.createFile("", currFilePath.getFilenameFromPath())
val outputFileDescriptor = contentResolver.openFileDescriptor(document!!.uri, "w")!!.fileDescriptor
setOutputFile(outputFileDescriptor)