Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cache directory doesn't exist


how is it possible that context.getApplicationContext().getCacheDir() returns null? As far as I know the internal cache directory should always exist.

Thanks!

like image 955
futtetennista Avatar asked Dec 14 '10 16:12

futtetennista


People also ask

Where is cache directory located?

Cache files are stored in C:/Documents and Settings/<UserName>/Local Settings/Temporary Internet Files. You can also discover the person's cookies in a similar location, C:/Documents and Settings/<User Name>/Cookies.

What is cache directory?

The cache directory is where files are stored during background uploads and after upload for quick access should you need to open the file from the network drive (Jungle Disk (Formerly Workgroup) and Desktop Edition users only).


1 Answers

maybe it returns null since you don't have enough internal storage? try to also use getExternalCacheDir

also , if it doesn't work , simply go to the path.

the standard is that it should give you the path "/data/data/YOUR_APP_PACKAGE_NAME/cache/" , and if you want the external storage cache , it should give you the path "EXTERNAL_STORAGE_PATH/Android/data/YOUR_APP_PACKAGE_NAME/cache/" .

like image 157
android developer Avatar answered Sep 29 '22 09:09

android developer