bSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String data = et.getText().toString();
String fileName = "";
count++;
fileName = "mytext" + count + ".txt"; //여기서 파일네임을 저장할때마다 mytext1,mytext2,3,4,5,6......이렇게 만들려고합니다.
FileOutputStream fos = null;
try {
File f = new File(mSDpath + "/mydir/fileName.txt"); //그럼 여기서 sd카드 mydir에 mytext들이
저장되 어야하는데 여기서 코드를 어떻게 해줘야할지 모르겠네요.. 저상태로하면 fileName이라는 txt파일이 생성되서 여기서 코드를 어떻게 바꿔야하나요?
fos = new FileOutputStream(f);
fos.write(data.getBytes());
fos.close();
Toast.makeText(getApplicationContext(),"메모가 저장되었습니다.",0).show();
//et.setText("저장완료");
} catch (Exception e) {
e.printStackTrace();
}
}
});
질문드립니다. ㅠㅠ 저기서 헤매고 있네여..