1
我想知道如果有人可以幫助我,我的應用程序當前使用多個捕獲圖像按鈕拍攝照片,我想要獲取每個圖像的文件路徑並將其保存到數據庫。我將如何去做這件事。我嘗試使用string name = fileuri.getpath
將它保存到我的數據庫中,但這並不能提供拍攝圖像的確切目標。如何獲取捕獲的圖像文件路徑並保存到數據庫?
else if (requestCode == CAMERA_CAPTURE_IMAGE_REQUEST_CODE_2) {
if (resultCode == RESULT_OK) {
String second_imagePath = fileUri.getPath();
BitmapFactory.Options options = new BitmapFactory.Options();
// down sizing image as it throws OutOfMemory Exception for larger
// images
options.inSampleSize = 8;
final Bitmap bitmap = BitmapFactory.decodeFile(second_imagePath, options);
second_image.setImageBitmap(bitmap);
Toast.makeText(getApplicationContext(),
second_imagePath, Toast.LENGTH_SHORT)
.show();
哎所以將文件路徑該圖像位於捕獲的圖像文件路徑,然後我會得到該字符串保存到我的數據庫? – user3461038
是的確切.... –
只是爲了undertsand爲什麼我需要傳遞圖像的名稱? – user3461038