SDCARD말고 내부저장소의 갤러리에 캡쳐한 사진을 저장하고 싶습니다..
누르면 토스트 메세지로 폴더생성과 저장됬다는 건 뜨는데
갤러리와 핸드폰 내부파일 그 어디에서도 캡쳐한 사진을 찾을 수 없습니다 ㅠㅠ
퍼미션 추가 당연히 해주었구요 (WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE 둘 다)
내부저장소 사용할거라 getFileDir()사용했는데 이 부분이 문제 일까요?
제발 알려주ㅅㅔ요 ㅠㅠㅠ
public void onClickCapture(View v) {
String path = getFilesDir()+"PageCapture";
final FrameLayout capture = (FrameLayout) findViewById(R.id.frame);//캡쳐할영역(프레임레이아웃)
File file = new File(path);
if(!file.exists()){
file.mkdirs();
Toast.makeText(this, "폴더가 생성되었습니다.", Toast.LENGTH_SHORT).show();
}
SimpleDateFormat day = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
capture.buildDrawingCache();
Bitmap captureview = capture.getDrawingCache();
FileOutputStream fos = null;
try{
fos = new FileOutputStream(path+"/Capture"+day.format(date)+".jpeg");
captureview.compress(Bitmap.CompressFormat.JPEG, 100, fos);
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + path + "/Capture" + day.format(date) + ".JPEG")));
Toast.makeText(this, "저장완료", Toast.LENGTH_SHORT).show();
fos.flush();
fos.close();
capture.destroyDrawingCache();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}