Hello, i have coded this simple application, what i want now is for my app when reopened to display the last image i had clicked last : <blockquote>
  <p>This is the MainActivity code</p>
</blockquote>

<pre><code>public class MainActivity extends AppCompatActivity {

    ImageView imageView;
    private static final int START_CAMERA_APP = 1;
    private String imageFileLocation = "";
    private static final int REQUEST_CODE = 0;


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

        imageView = (ImageView)findViewById(R.id.img_cam);
    }
</code></pre>

<blockquote>
  <p>Method to open the camera</p>
</blockquote>

<pre><code> public void takePhoto (View view)
        {
            Intent openCamera = new Intent();
            openCamera.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
            File photoFile = null;
            try {
                photoFile = createImageFile();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            openCamera.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
            startActivityForResult(openCamera,START_CAMERA_APP);


        }
</code></pre>

<blockquote>
  <p>onActivity method to return the captured image</p>
</blockquote>

<pre><code>@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode == START_CAMERA_APP &amp;&amp; resultCode == RESULT_OK)
        {
            Bitmap photoCapturedBitmap = BitmapFactory.decodeFile(imageFileLocation);
            imageView.setImageBitmap(photoCapturedBitmap);
        }

        if(requestCode == REQUEST_CODE &amp;&amp; resultCode == RESULT_OK)
        {
            Uri uri = null;
            if (data != null)
            {
                uri = data.getData();
                Bitmap bitmap = null;
                try {
                    bitmap = getBitmapFromUri(uri);
                    imageView.setImageBitmap(bitmap);
                } catch (IOException e) {
                    e.printStackTrace();
                }

            }
        }

    }
</code></pre>

<blockquote>
  <p>Method to create the image</p>
</blockquote>

<pre><code> File createImageFile() throws IOException
    {
        String timeStamp = new SimpleDateFormat("yyyyMMdd+HHmmss").format(new Date());
        String imageFileName = "IMAGE" + timeStamp+ "_";
        File storageDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
        File image = File.createTempFile(imageFileName, ".jpg",storageDirectory);
        imageFileLocation = image.getAbsolutePath();
        return image;
    }
</code></pre>

<blockquote>
  <p>And finally methods related to the gallery
      public void gallery(View view)
      {</p>
</blockquote>

<pre><code>    Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    intent.setType("image/*");
    startActivityForResult(intent,REQUEST_CODE);
}


  private Bitmap getBitmapFromUri (Uri uri) throws IOException
    {
        ParcelFileDescriptor parcelFileDescriptor = getContentResolver().openFileDescriptor(uri,"r");
        FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
        Bitmap bitmap = BitmapFactory.decodeFileDescriptor(fileDescriptor);
        parcelFileDescriptor.close();
        return bitmap;
    }
</code></pre>

<p>}</p>
