项目中要做一个远程删除的功能
要删除所有可能我们应用流下来的文件。
但是在SD卡和内置存储空间都存在的情况下。
Environment.getExternalStorageDirectory()一直只能获取到sd卡的目录。
然后在网上也找了,一直没找到怎么访问内置存储空间的办法,后面一位朋友说用ES文件浏览器看看。
果然找到了 ,
sd卡的目录叫做:/mnt/sdcard/
内置存储空间的目录是:/mnt/sdcard2/
File file = Environment.getDataDirectory(); // ---> /data
File file1 = Environment.getDownloadCacheDirectory(); // --->/cache
File file2 = Environment.getExternalStorageDirectory(); // --->/mnt/sdcard
File file3 = Environment.getRootDirectory(); // --->/system
String file4 = Environment.getExternalStorageState(); // ---->mounted
File file5 = this.getCacheDir(); // ---->/data/data/com.pan.by.test/cache
File file6 = this.getExternalCacheDir(); // --->null(外部存储缓存目录)
File file7 = this.getFilesDir(); //--->/data/data/com.pan.by.test/files