아래와같이 변경해봤습니다.
이번에 발생하는 오류는 다음과 같습니다.
파일이 생기지 않는것같은데요.. 경로상에 파일을 생성할수없는것인가요?
e: "java.io.FileNotFoundException: /storage/emulated/0/coffee/dessert1.jpg: open failed: ENOENT (No such file or directory)"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.administrator.coffee_b01">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
boolean SaveImage()
{
String dirPath = Environment.getExternalStorageDirectory()+"/coffee";
String filename = m_strFile;
File dir = new File(dirPath);
if(!dir.exists()){
dir.mkdir();
}
File file = new File(dir, filename);
try{
FileOutputStream fos = new FileOutputStream(file);
m_image_bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.close();
return true;
}catch (Exception e){
e.printStackTrace();
return false;
}
}