context.getCachedir()和Environment getConDownloadCacheDirectory android

San*_*ull 1 android android-sdcard

是否context.getCachedir()与环境getConDownloadCacheDirectory一样吗?

我正在实现位图缓存并混淆使用哪一个.
如果我使用上下文,那么我们将需要保持对上下文的引用,这可能会导致内存泄漏.
那么哪一个使用?

Ali*_*ran 5

是的,有区别.

context.getCachedir()=/data/data/your.application.package/cache(这是绝对路径)

Environment.getConDownloadCacheDirectory()=/cache(这是相对路径)