How to check availability of space on external storage?

后端 未结 6 1736
无人及你
无人及你 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 00:44

    I think you can use this statement to do with your problem. this cant check whether or no enough capacity of sdcard.

    if(android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)){
        //to do something in here
    }
    

提交回复
热议问题