Android get free size of internal/external memory

前端 未结 13 1211
眼角桃花
眼角桃花 2020-11-22 15:20

I want to get the size of free memory on internal/external storage of my device programmatically. I\'m using this piece of code :

StatFs stat = new StatFs(En         


        
13条回答
  •  半阙折子戏
    2020-11-22 15:47

    @Android-Droid - you are wrong Environment.getExternalStorageDirectory() points to external storage which does not have to be SD card, it can also be mount of internal memory. See:

    Find an external SD card location

提交回复
热议问题