I am passing filepath to MediaRecorder for creating video file.
File(filePath).exists()
returns false,
but MediaRecorder fails with IOException,
java.io.FileNotFoundException: /storage/emulated/0/DCIM/XXX/XXX0001.mp4: open failed: EEXIST (File exists)
I have tried creating Uri by getContentResolver().insert()
, but it also gives UNIQUE constraint failed: files._data (code 2067 SQLITE_CONSTRAINT_UNIQUE[2067])
Problem doesn't come in a new phone in which I had never tested my application. Problem starts If I delete video from file Manager.