我的设备中没有SD卡,但以下代码返回true。
Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
答案 0 :(得分:1)
请检查
boolean isSDCardmounted = false;
isSDCardmounted = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)
if(isSDCardmounted ){
//Sd card available
}else{
//SD Card not available
}
答案 1 :(得分:0)
Boolean isSDAvailable = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
if(isSDAvailable )
{
// yes SD-card is Available
}
else
{
// Not Find sd card
}