0
今日、私は通常のパスの代わりに "ファイル"をテストしました。 illegal Arguments: contains a path seperator
:エラーコードでOutputStreamWriterにパスセパレータが含まれています
File path=new File(getFilesDir(),"uf");
File test = new File(path.getAbsolutePath(),"test.txt");
if(!path.exists()){
path.mkdir();
}
if(!test.isFile()){
try {
test.createNewFile();
} catch (IOException e) {
//TODO in errorlog -> filecreation
e.printStackTrace();
}
}else{
try {
OutputStreamWriter mywriter = new OutputStreamWriter(openFileOutput(test.getAbsolutePath().toString(),Context.M ODE_PRIVATE));
mywriter.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
は毎回来る:
はここに私のコードです!
ありがとうございました
常に完全な例外を指定してください。 – Hrabosch