- UID
- 47
- 性别
- 保密
- 注册时间
- 2013-8-27
- 威望
-
- 金币
-
- Z币
-
- 听众
|
6格式化SD卡/卸载SD卡
private IMountService mMountService;
mMountService = getMountService();
private synchronized IMountService getMountService() {
if (mMountService == null) {
IBinder service = ServiceManager.getService("mount");
if (service != null) {
mMountService = IMountService.Stub.asInterface(service);
} else {
Log.e(TAG, "Cant get mount service");
}
}
return mMountService;
}
//format sdcard
mMountService.formatMedia(Environment.getExternalStorageDirectory().toString());
//unmount sdcard
mMountService.unmountMedia(Environment.getExternalStorageDirectory().toString());
|
|