Unable to write files in Android P
I couldn’t write files in Android P Memory Card. The same code is working fine in Android O. new File(file.getParent()).mkdirs(); output = new ObjectOutputStream(new FileOutputStream(file)); output.writeObject(obj); I am able to read the files from the same device(Memory Card), but when I try to write the file, it is throwing Permission Denied exception. Initially it was throwing me No such file or Directory , but after giving root permissions, it is throwing Permission Deniod exception. Note: My app is system privileged app and also I have given the Devicewith root permission by adb root,