FANDOM


To capture a large image, pass to the CameraIntent a URI for a file location to store the result;

imageFileUri = Uri.parse("file:///sdcard/some_image.jpg");

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageFileUri);

startActivityForResult(i, CAMERA_RESULT);

This stores the file to the external sdcard storage, you can also create this path like so;

String imageFilePath = Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/imagejpg.jpg";
File imageFile = new File(imageFilePath);
Uri imageFileUri = Uri.fromFile(imageFile);



To deal with the return result, implement the onActivityResult method


protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{
  super.onActivityResult(requestCode, resultCode, intent);
  if (resultCode == RESULT_OK)
  {
  
     takePictureButton.setVisibility(View.GONE);
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.