Created file disappears when Android app is killed programatically

Viewed 43

I am creating a file in Android:

        File eFile = new File("/data/user/0/myapp/WeANDSF/E1"); 
        eFile.createNewFile();

This works perfectly and I can see the file in the device file explorer in AS. If I kill the using "Force Stop" then all is okay and the file remains there.

However, if I kill it using one of:

    Runtime.getRuntime().exit(0);
    System.exit(0);

The file disappears.

The reason I need to kill the app is complicated.

Why is my file disappearing?

0 Answers
Related