SoFunction
Updated on 2025-03-11

Android implements the function example of the image taken by returning to the image taken

This article describes the Android implementation of the image returned to the image. Share it for your reference. The details are as follows:

first step:

try {
  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  startActivityForResult(intent, 0);
 
} catch (ActivityNotFoundException e) {
  // Do nothing for now
}

Step 2:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
 try {
  if (requestCode != 0) {
  return;
  }
  (requestCode, resultCode, data);
  Bundle extras = ();
  Bitmap b = (Bitmap) ("data");
  //
  //
  ImageView a = (ImageView)findViewById(.imageView1);
  (b);
  //
  /*
   * Get pictures to process pictures...
   */
 } catch (Exception e) {
  // TODO: handle exception
  (());
 }
}

I hope this article will be helpful to everyone's Android programming design.