mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-04-08 23:51:16 +02:00
fix deleting files on Android 10
This commit is contained in:
parent
1c05c8a685
commit
52a38e4dc1
@ -175,7 +175,13 @@ class RecordingsAdapter(
|
|||||||
val uri = Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY)
|
val uri = Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY)
|
||||||
val selection = "${Media._ID} = ?"
|
val selection = "${Media._ID} = ?"
|
||||||
val selectionArgs = arrayOf(it.id.toString())
|
val selectionArgs = arrayOf(it.id.toString())
|
||||||
activity.contentResolver.delete(uri, selection, selectionArgs)
|
val result = activity.contentResolver.delete(uri, selection, selectionArgs)
|
||||||
|
|
||||||
|
if (result == 0) {
|
||||||
|
recordingsToRemove.forEach {
|
||||||
|
activity.deleteFile(File(it.path).toFileDirItem(activity))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
doDeleteAnimation(oldRecordingIndex, recordingsToRemove, positions)
|
doDeleteAnimation(oldRecordingIndex, recordingsToRemove, positions)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user