How to Make a Photo Taken Open Up in a New Activity? : <p>I coded when you click the button the camera opens and takes a new picture. I want that picture to turn into an ImageView on a new Activity. So I created the new activity and placed an ImageView on it:</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.amy.teacherfilesapp.Upload"&gt;

        &lt;ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/imageView"
        android:scaleType="centerCrop"
        /&gt;


&lt;/android.support.constraint.ConstraintLayout&gt;
</code></pre>

<p>And then on the Main Activity I put(this whole thing applies to <code>btn2</code>so you can ignore btn1 &amp; btn3, thanks):`package com.example.amy.teacherfilesapp;</p>

<pre><code>import android.content.Intent;
import android.graphics.Bitmap;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;


public class MainActivity extends AppCompatActivity {

    Button btn1;
    Button btn2;
    Button btn3;
    ImageView imgTakenPic;
    private static final int CAM_REQUEST=1313;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        btn2 = (Button) findViewById(R.id.drawer_two);
        imgTakenPic = (ImageView)findViewById(R.id.imageView);
        btn2.setOnClickListener(new btnTakePhotoClicker());

        btn1 = (Button)findViewById(R.id.drawer_one);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent openCabinet = new Intent(MainActivity.this,MyCabinet.class);
                startActivity(openCabinet);
            }
        });

        btn2 =(Button)findViewById(R.id.drawer_two);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent upload = new Intent("android.media.action.IMAGE_CAPTURE");
                startActivity(upload);
            }
        });

        btn3 = (Button)findViewById(R.id.drawer_three);
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent settings = new Intent(MainActivity.this, Settings.class);
                startActivity(settings);
            }
        });





    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if(requestCode == CAM_REQUEST){
            Bitmap bitmap = (Bitmap) data.getExtras().get("data");
            imgTakenPic.setImageBitmap(bitmap);
        }
    }

    class btnTakePhotoClicker implements  Button.OnClickListener{

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            startActivityForResult(intent,CAM_REQUEST);
        }
    }
}
</code></pre>

<p>`</p>

<p>This didn't work as it didn't display the image anywhere I could see. </p>

<p>I would be very grateful if you could help me. Thanks.</p>
