
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 = "memo" + count + ".txt";
FileOutputStream fos = null;
try {
File f = new File(mSDpath + "/mydir/" + fileName);
fos = new FileOutputStream(f);
fos.write(data.getBytes());
fos.close();
Toast.makeText(getApplicationContext(), "메모가 저장되었습니다.", 0)
.show();
} catch (Exception e) {
e.printStackTrace();
}
}
현재 저장버튼을 누르면 EditText에 입력한 텍스트들이 위 코드처럼 txt파일로 저장이됩니다.
근데 여기서 ImageView를 클릭하면 카메라 갤러리가뜨고 갤러리에서 사진선택을 하면 해당 사진이
ImageView에 들어가게 구현을 시켰는데
저장 버튼을 눌렀을때 ImageView에 들어간 사진도 위 코드처럼 저장하고싶은데요
어떻게 해야 할까요 .. 확장자는 png로 해야할거같은데 저기위에서 코드를 어떻게 합쳐야할지
모르겠습니다.