Skip to content

Folder to save files must not be set to Environment.getExternalStorageDirectory() #259

@GoogleCodeExporter

Description

@GoogleCodeExporter
I think that folders to save files must not be set to 
Environment.getExternalStorageDirectory().
If we remove the SD card of a device this path can be unavailable...

I think the subpath must calculate each time with something like :

        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            Log.v(TAG, "External storage available");
            path = context.getExternalFilesDir(null);
        }
        if (path == null) {
            Log.w(TAG, "External storage unavailable - using local memory");
            path = context.getFilesDir();
        }

Attention to the calculation of the remaining space.


Original issue reported on code.google.com by benoit.j...@gmail.com on 4 Apr 2014 at 3:40

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions