로그의 851 번째 NullPointException 은 out.close()입니다.
현재 Bitmap은 들어온 상태구요. 메소드에서 에러납니다. ㅠ
public void SaveBitmapToFileCache(Bitmap bitmap, String strFilePath, String filename) {
File copyFile = new File(strFilePath+filename+".jpg");
OutputStream out = null;
try {
copyFile.createNewFile();
out = new FileOutputStream(copyFile);
bitmap.compress(CompressFormat.JPEG, 100, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
---------------------------------------------------------------------------
본문 , ( 모든 권한 추가함)
System.out.println("photo : " + photo);
filename = "crop";
String ex_storage = Environment.getExternalStorageDirectory().getAbsolutePath();
strFilePath = ex_storage;
SaveBitmapToFileCache(photo, strFilePath , filename);
--------------------------------------------------------------------------
Log
photo : android.graphics.Bitmap@4432e7a0
java.io.IOException: open failed: EACCES (Permission denied)
at java.io.File.createNewFile(File.java:946)
Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at java.io.File.createNewFile(File.java:939)
... 15 more
Caused by: java.lang.NullPointerException