/**
* 获取内部存储剩余空间大小,单位:Mb
* @return
*/
public static long getInnerStorageFreeSpace(){
if(Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
File datapath = Environment.getExternalStorageDirectory();
StatFs dataFs = new StatFs(datapath.getAbsolutePath());
long sizes = dataFs.getFreeBlocksLong() * dataFs.getBlockSizeLong();
return sizes / 1024 / 1024;
}
return 0;
}
获取内部存储空间可用大小
最新推荐文章于 2021-08-04 18:08:51 发布