这样该怎么操作 。。 openfileStream 好像只能不能加入路径分隔符
直接new
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/data/data/com.**.**/files);
楼上说的对,路径分隔符还可以用这个File.separator 适应多系统
实际上楼上的是对的,写法很多种,个人是这样写的:
创建指定路径下文件夹
public static File getCacheFile(String name) {
String cachePath;
Context context = BaseApplication.getAppContext();
if (Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState())
|| !Environment.isExternalStorageRemovable()) {
cachePath = context.getExternalCacheDir().getPath();
} else {
cachePath = context.getCacheDir().getPath();
}
return new File(cachePath + File.separator + name);
}
然后new file()创建文件