获取data区剩余空间的API
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
获取data区剩余空间的API
[SOLUTION]
import android.os.StatFs;
import android.os.Environment;
final StatFs internalStats = new
StatFs(Environment.getDataDirectory().getPath());
final long availInternalSize = (long) internalStats.getAvailableBlocks() *
(long) internalStats.getBlockSize();
上面availInternalSize就是data区的剩余空间。
获取data区剩余空间的API
[SOLUTION]
import android.os.StatFs;
import android.os.Environment;
final StatFs internalStats = new
StatFs(Environment.getDataDirectory().getPath());
final long availInternalSize = (long) internalStats.getAvailableBlocks() *
(long) internalStats.getBlockSize();
上面availInternalSize就是data区的剩余空间。
学习了~~~~~~