本文共 562 字,大约阅读时间需要 1 分钟。
1 2 3 4 5 6 7 8 9 10 11 12 13 | File cacheDir = mContext.getExternalCacheDir(); if ( null != cacheDir){ mCacheDirPath = cacheDir.getAbsolutePath() + "/images/" ; } if (TextUtils.isEmpty(mCacheDirPath)){ if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){ mCacheDirPath = Environment.getExternalStorageDirectory().getPath() + "/Android/data/com.meiyaapp.meiya/cache/images/" ; } else { Toast.makeText(mContext, "SD卡状态错误,请调整后重试哦。" ,Toast.LENGTH_SHORT).show(); } } |