Created
August 28, 2015 12:33
-
-
Save IlyaEremin/6c8156e5574b18b3b26c to your computer and use it in GitHub Desktop.
dagger cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Provides @CacheDir File provideCacheDir(Context context) { | |
File f = Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) | |
? context.getExternalCacheDir() | |
: context.getCacheDir(); | |
if (f != null) { | |
f.mkdirs(); | |
} | |
return f; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment