检测是否有SD卡:
true:有,false:无
public class Tools { /** * 检查是否存在SD卡 */ public static boolean hasSdcard() { String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED)) { return true; } else { return false; } } }
检测是否有SD卡:
true:有,false:无
public class Tools { /** * 检查是否存在SD卡 */ public static boolean hasSdcard() { String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED)) { return true; } else { return false; } } }