where is the file when use getCacheDir

后端 未结 1 1067
遇见更好的自我
遇见更好的自我 2021-01-18 03:36

As I debugged, I found that the GetCacheDir return /data/data/yourapp/cache/

But as I store files, I found nothing in that path(with shell), but in

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 04:08

    As I debugged, I found that the GetCacheDir return /data/data/yourapp/cache/

    That sounds right for getCacheDir.

    But as I store files, I found nothing in that path(with shell), but in /sdcard/Android/data/yourapp/cache/ I found the cache file? who can tell me why?

    That's what you'd get from getExternalCacheDir.

    Are you sure you're using the right API call? Did you check the return values of your File operations (are they all successful)? You could try some File functions to check that things are working right. (createNewFile, exists, getAbsolutePath)

    0 讨论(0)
提交回复
热议问题