Android Studio AVD Manager not mounting sd card

2019-09-01 07:22发布

问题:

I am using the emulator with the Nexus 5 image and when I try to access the external public storage using the following code, the storage doesn't seem to be mounted.

    String state = Environment.getExternalStorageState();
    boolean m = Environment.MEDIA_MOUNTED.equals(state);

This returns false. I went to the .android/avd/Nexus_5_API_21_x86.avd/config.ini file and changed hw.sdCard to "yes" as well, but that didn't really help. Not exactly sure what I am doing wrong. I would assume the sdcard should be mounted by default.

标签: android avd