0
我想將我的圖片保存在我選擇的文件夾中;我有以下代碼保存在我的設置的默認文件夾圖像;我怎樣才能修改我的應用程序的代碼?從onPictureTaken保存圖片在我的文件夾中的sd
PictureCallback myPictureCallback_JPG = new PictureCallback(){
@Override
public void onPictureTaken(byte[] arg0, Camera arg1) {
Uri uriTarget = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, new ContentValues());
OutputStream imageFileOS;
try {
imageFileOS = getContentResolver().openOutputStream(uriTarget);
imageFileOS.write(arg0);
imageFileOS.flush();
imageFileOS.close();
Toast.makeText(FotoActivity.this,
"Image saved: " + uriTarget.toString(),
Toast.LENGTH_LONG).show();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
camera.startPreview();
}};
沒有ü解決了這個問題? – KOTIOS
不......你能幫我嗎? – Juppy
是我可以嘗試幫助你 – KOTIOS