public void fileSave() {
String path = Environment.getExternalStorageDirectory().getAbsolutePath();
File dir = new File(path, "KSJ" );
dir.mkdir();
String fileName = "android.txt" ;
File file = new File(dir + fileName);
String text = "notice test" ;
FileOutputStream fos = null ;
try {
fos = new FileOutputStream(file);
fos.write((text).getBytes());
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
|
안녕하세요 질문이 있어서요~
파일로 저장할 일이 생겨서 그럽니다.
위의 소스로 테스트를 해봤는데요.
폴더는 생성이 되는데요.
텍스트 문서가 폴더안에 생기는 것이 아니라 sdcard 최상위 루트에 생성되네요.;;
왜 why??????????????????? 그런건지요?