MMS 이미지 첨부하여 보낼때 내장메모리의 어플리케이션 저장 경로의 이미지 Uri를 생성할 수 없나요?
private boolean imageSaved() {
boolean result = true;
FileOutputStream fos = null;
try {
fos = openFileOutput("qrbarcode.jpg", 0);
bitmap.compress(CompressFormat.JPEG, 100, fos);
} catch (Exception e) {
// TODO: handle exception
result = false;
Log.v(TAG, "비트맵 저장 실패 : " + e);
} finally {
try {
fos.close();
} catch (Exception e) {
// TODO: handle exception
result = false;
Log.v(TAG, "스트림 닫기 실패 : " + e);
}
}
return result;
}
위처럼 어플리케이션의 저장 위치에 이미지를 저장하고
private void sendMMS() {
File file = new File("data/data/com.edb.mobileprescription/files/qrbarcode.jpg");
Uri uri = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType ( "image/*");
intent.addCategory("android.intent.category.DEFAULT");
intent.putExtra("exit_on_sent", true);
intent.putExtra ("address", "01030828659");
intent.putExtra (Intent.EXTRA_STREAM, uri);
startActivity(intent);
}
위처럼 MMS를 보낼때 이미지 위치의 uri를 생성하여 이미지 첨부를 하는데
결과 메시지가 "첨부할 수 없는 파일입니다"라고 토스트가 띄워지네요.
SD카드의 download폴더에서 불러올땐 정상적으로 첨부가 되는데 내장메모리에서 불러올때는 첨부가 안되는데
이게 내장메모리때문은 아닌것 같은데 이유를 모르겠습니다.