is it there a standard way to retrieve the path of an saves image taken by the camera, because i found different ways to display the path but they cause the App to crash. and since i'm new to android programming i just need some guidance. Please check the code:
Java Code:
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File imagesFolder = new File(Environment.getExternalStorageDirectory(), "My Images");
imagesFolder.mkdirs();
File image = new File(imagesFolder, "img01");
uriSavedImage = Uri.fromFile(image);
File f = new File (uriSavedImage.getPath());// <---------
//imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, f.getPath()); // <---------
startActivityForResult(imageIntent,CAMERA_REQUEST_CODE);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if ((requestCode == CAMERA_REQUEST_CODE) && (resultCode == RESULT_OK)) {
Toast.makeText(getApplicationContext(),// <---------
" "+data.getData(),
Toast.LENGTH_SHORT).show();