Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用getCacheDir时文件在哪里_Android - Fatal编程技术网

Android 使用getCacheDir时文件在哪里

Android 使用getCacheDir时文件在哪里,android,Android,在调试时,我发现GetCacheDir返回/data/data/yourapp/cache/ 但当我存储文件时,我在该路径中找不到任何东西(使用shell), 但是在/sdcard/Android/data/yourapp/cache/中我找到了缓存文件? 谁能告诉我为什么 在调试时,我发现GetCacheDir返回/data/data/yourapp/cache/ 这听起来很适合我 但是,当我存储文件时,我在该路径(使用shell)中找不到任何东西,但在/sdcard/Android/data

在调试时,我发现GetCacheDir返回
/data/data/yourapp/cache/

但当我存储文件时,我在该路径中找不到任何东西(使用shell), 但是在
/sdcard/Android/data/yourapp/cache/
中我找到了缓存文件? 谁能告诉我为什么

在调试时,我发现GetCacheDir返回/data/data/yourapp/cache/

这听起来很适合我

但是,当我存储文件时,我在该路径(使用shell)中找不到任何东西,但在/sdcard/Android/data/yourapp/cache/I中找到了缓存文件?谁能告诉我为什么

这就是你从中得到的


您确定使用了正确的API调用吗?您是否检查了文件操作的返回值(它们是否都成功)?您可以尝试使用一些文件函数来检查工作是否正常。(createNewFile,exists,getAbsolutePath)

奇怪!我以前从未见过这种情况。你从日志上看到什么了吗?