推断手机上是否有SD卡存在。作为经常用法,写到工具类里,用时直接调用。代码例如以下:
public static boolean hasSdcard(){ String state = Environment.getExternalStorageState(); if(state.equals(Environment.MEDIA_MOUNTED)){ return true; }else{ return false; } }
原文:http://www.cnblogs.com/yangykaifa/p/7225696.html