Android 判断是不是有外置SD卡(包含手机存储的情况下)

Android 判断是否有外置SD卡(包含手机存储的情况下)

前言
         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         CSDN:
http://www.csdn.net
         雨季o莫忧离:http://blog.csdn.net/luckkof

正文

 

 

 

			String path = null;
		   try {
				path = android.os.SystemProperties.get("external_sd_path");
	            LogUtils.d(TAG, "current card id=  " + path);
			} catch (IllegalArgumentException e) {
			}
			if(path.equals("/storage/sdcard0")){
	            LogUtils.d(TAG, "current card id=  有sd卡" + path);
			}else{
	            LogUtils.d(TAG, "current card id=  没有sd卡" + path);
			}