//here is my gallery intent
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
                    photoPickerIntent.setType("image/*");
                    startActivityForResult(photoPickerIntent,2);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
           if (requestCode == 2) {
                Bitmap bm=null;
                if (data != null) {
                    try {
                        bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData());
                        imageView.setImageBitmap(bm);
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                Uri tempUri = getImageUri(getApplicationContext(), bm);
                File finalFile = new File(getRealPathFromURI(tempUri));
            } }
I am implementing camera and gallery intent in my android app.when i capture the through camera the image is displayed in imageview but if i try to display the same camera image through gallery intent the image is not displaying.
Note:captured image is not displaying through gallery intent but other folder images are displaying in imageview
 
     
    