I need a way to read images back into an android app I am developing. The images get saved to a custom folder called Venns Road Accident. I have looked at multiple sources however nothing seems to work for me.
This is the code to capture and save the images.
This is the code to capture and save the images.
Code:
public void Pictures (View v)
{
//Call the camera and get phone date and time
Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
//Create the folder for the images to be saved
File imagesFolder = new File(Environment.getExternalStorageDirectory(), "Venns Road Accident");
imagesFolder.mkdirs();
//Apply the system date and time as the name of the image
File image = new File(imagesFolder, "VCA_" + timeStamp + ".png");
Uri uriSavedImage = Uri.fromFile(image);
//Saving of image and allowing for new image to be captured
imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
startActivityForResult(imageIntent, CAMERA_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAMERA_REQUEST)
Toast.makeText(Pictures.this, "Image Saved", Toast.LENGTH_LONG).show();
else
Toast.makeText(Pictures.this, "Image not Saved", Toast.LENGTH_LONG).show();
}