How to get the internal and external sdcard path in android

前端 未结 8 539
北恋
北恋 2020-12-09 09:23

Most of the new android devices have an internal sdcard and an external sdcard. I want to make a file explorer app but I can\'t find out how to get the path to use in my app

8条回答
  •  粉色の甜心
    2020-12-09 10:17

    Try this code it will help

    Map externalLocations = ExternalStorage.getAllStorageLocations();
    File sdCard = externalLocations.get(ExternalStorage.SD_CARD);
    File externalSdCard = externalLocations.get(ExternalStorage.EXTERNAL_SD_CARD);
    

提交回复
热议问题