移动云

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 8423|回复: 0

android sd卡剩余空间

[复制链接]
发表于 2013-6-20 14:51:35 | 显示全部楼层 |阅读模式
String sdcard = Environment.getExternalStorageDirectory().getPath();
                File file = new File(sdcard);
                StatFs statFs = new StatFs(file.getPath());
                int availableSpare = (int) (statFs.getBlockSize()*((long)statFs.getAvailableBlocks()-4));
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|管理员QQ:44994224|邮箱(t268studio@gmail.com)|Archiver|MCLOUDER

GMT+8, 2025-7-2 03:37 , Processed in 0.032453 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表