StatFs stat = new StatFs(path.getPath());
String totalStr = Formatter.formatFileSize(this, stat.getFreeBytes());
String availStr = Formatter.formatFileSize(this, stat.getAvailableBytes());
"设备空闲空间:"+totalStr+";可用空间:"+availStr;
转载于:https://my.oschina.net/jingshishengxu/blog/653968