private boolean haveSdcard(){
StorageManager manager = (StorageManager) getSystemService(STORAGE_SERVICE);
StorageVolume[] mVolumes=manager.getVolumeList();
String ExternalStorage=null;
for(StorageVolume mVolume:mVolumes){
if(mVolume.isRemovable()){
ExternalStorage=mVolume.getPath();
}
}
if (ExternalStorage != null && testSd(ExternalStorage)) {
return true;
}else{
return false;
}
}
private boolean testSd(String interStorage) {
StatFs mStatFs = new StatFs(interStorage);
if (mStatFs.getBlockCount() > 0) {
return true;
} else {
return false;
}
}