got "Operation not permitted" when try to crate second file on android sdk 24. in the first one have no problem. all ready have permission in the manifest
code:
fun createVideoFileName(): File? {
val name = "VIDEO"
val videoFile = File.createTempFile(name , ".mp4", VideoFolder)
val audioFile = File.createTempFile(name , ".mp3", VideoFolder)
AudioFileName = audioFile.absolutePath
return videoFile.absolutePath
}
manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
if i delete "VideoFolder" in the second line it work and create it to tmp dir if i crate only first file it's work. if i using another dir it don't work
directory are exists
error:
W/System.err: java.io.IOException: Operation not permitted W/System.err: at java.io.UnixFileSystem.createFileExclusively0(Native Method) W/System.err: at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:317) W/System.err: at java.io.File.createTempFile(File.java:2018) W/System.er