protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_OK) {
return;
} else if (requestCode == PICK_FROM_ALBUM && resultCode == RESULT_OK) {
try {
File path = new File("/sdcard/image/");
if(!path.isDirectory())
{
path.mkdir();
}
String fpath = "/sdcard/image/image.jpg";
File file = new File(fpath);
{
if(file.exists())
{
file.delete();
}
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
새로 디렉토리 만들어서 저장하는건데 절대경로에 확장자가 붙나요 ???
그리고 불러오는 소스는
bmp = BitmapFactory.decodeFile("/sdcard/image/image.jpg",options);
imageV.setImageBitmap(bmp);
}
두줄해서 불러오는데 LogCat에서 아무것도 안뜨고 실행이 안됩니다.
1번파일에서 저장하고
2번파일에서 불러오고 있습니다. 소스좀 봐주시면 감사하겠습니다,




Environment.getExternalStorageDirectory().getAbsolutePath();