How to check availability of space on external storage?

后端 未结 6 1733
无人及你
无人及你 2021-01-08 00:24

How do you check if the SD card is full or not so that your application can decide if it can continue to do its job i.e. write to external storage or notify the user that st

6条回答
  •  情歌与酒
    2021-01-08 01:03

    Use StatFs and pass the path of the external storage directory to the constructor and you can call functions such as getAvailableBlocks() and getBlockSize() on the StatFs object.

提交回复
热议问题