title: Camera Image not displaying in ImageView
body: <p>I want to display a captured image from a Camera Intent inside an ImageView. I am able to get the camera to open and make a directory for the image, but when I pass the image through the intent and attempt to call it, the image is not displayed. This is what I am doing:</p>
  
  <pre><code>private static final int REQUEST_CODE = 1;
  private ImageView addPicture;
  private Bitmap bitmap;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(//setting the view);
  
      addPicture.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
              File imagesFolder = new File(Environment.getExternalStorageDirectory(), "MyImages");
              imagesFolder.mkdirs(); // &lt;----
              File image = new File(imagesFolder, "image_001.jpg");
              Uri uriSavedImage = Uri.fromFile(image);
              imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
              startActivityForResult(imageIntent, 0);
          }
      });
  
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      addPicture = (ImageView) findViewById(R.id.profilepicture_registerone);
  
      if (requestCode == REQUEST_CODE) {
          if (resultCode == RESULT_OK) {
              try {
                  InputStream stream = getContentResolver().openInputStream(data.getData());
                  bitmap = BitmapFactory.decodeStream(stream);
                  addPicture.setImageBitmap(bitmap);
                  stream.close();
  
  
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              } catch (IOException e) {
  
              }
  
              RoundImage image = new RoundImage(bitmap);
  
          } else if (resultCode == RESULT_CANCELED) {
              // User cancelled the image capture
          } else {
              Toast.makeText(getApplicationContext(), "Bad Image Request. Please Try Again!", Toast.LENGTH_LONG).show();
          }
      }
  
  }
  </code></pre>
  
  <p>My Permissions:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  
  &lt;uses-feature android:name="android.hardware.camera" /&gt;
  </code></pre>
  
  <p>And My ImageView in XML:</p>
  
  <pre><code>&lt;ImageView
      android:layout_width="200dp"
      android:layout_height="200dp"
      android:id="@+id/profilepicture_registerone"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="50dp"
      android:clickable="true"
      android:onClick="addPicture" /&gt;
  </code></pre>
  
  <p><strong>EDIT: I had the incorrect IDs due to me attempting to change things for this post. I changed them back to the original ID to avoid any more confusion.</strong></p>
  
  <p><strong>EDIT 2: After further testing, I've found that no Images are being set inside of the <code>onActivityResult()</code> method. I tried loading a drawable image and that did not work either. It worked when I called it inside of <code>onCreate()</code>.</strong></p>