Question

In the emulator I can't seem to write to the attached SDCard. The following code always spits out the "can't write root" log message, but not the "can't read root" one.

File routesRoot = Environment.getExternalStorageDirectory();
if (!routesRoot.canWrite())
    Log.v(getClass().getSimpleName(), "can't write root");
if (!routesRoot.canRead())
    Log.v(getClass().getSimpleName(), "can't read root");

Ideas?

Was it helpful?

Solution

Check, and then double check that you have the WRITE_EXTERNAL_STORAGE permission.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top