How can I listen for file deletion events in the file manager and create a backup file Android?

50 Views Asked by At

The problem I need to solve is to listen for a file deletion event in the device's file manager and create a backup file to store it in a specific directory. illustrative image

I have tried using FileObserver(), but it seems to not work as expected. FileObserver only returns the path after the file has been deleted, which means I cannot create a backup file.

Is there any way to solve this issue using a BroadcastReceiver? I have attempted to find a suitable Intent Action but have been unsuccessful so far.

Is there any way to solve this issue or not?

0

There are 0 best solutions below