I've got th开发者_如何学Goe "No space left on device" IOException when writing file. I wish to avoid it happens before writing. How should I do?
Thanks!
from: http://groups.google.com/group/android-developers/browse_thread/thread/ecede996463a4058
StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath());
long bytesAvailable = (long)stat.getBlockSize() * (long)stat.getBlockCount();
long megAvailable = bytesAvailable / 1048576;
精彩评论