0

I've created my own app with a pick image button similar to the "Taking photos simply" tutorial at https://developer.android.com/training/camera/photobasics.html

The photo save successfully, however I cannot view or choose them from the camera app. Is there a way to enable this?

Using existing camera app from my app

private void dispatchTakePictureIntent() {
        Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        // Ensure that there's a camera activity to handle the intent
        if (takePictureIntent.resolveActivity(context.getPackageManager()) != null) {
            // Create the File where the photo should go
            File photoFile = null; 
            photoFile = createFileInDownload();

            // Continue only if the File was successfully created
            if (photoFile != null) {

                Uri photoURI = Uri.fromFile(photoFile);
                takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
                startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
            }
        }
    }

Note: When I use my phone defualt camera app, I can access previous taken photos:

Default phone camera app

user3796320
  • 327
  • 1
  • 2
  • 9
  • `ACTION_IMAGE_CAPTURE` means capturing an image. see http://stackoverflow.com/questions/5309190/android-pick-images-from-gallery for picking an image – njzk2 May 08 '17 at 15:35
  • There are hundreds of different pre-installed camera apps across the ~2 billion Android devices. There are hundreds of additional camera apps that users can install. Any of those camera apps could respond to your `ACTION_IMAGE_CAPTURE` `Intent`. None have to have any UI for browsing past photos. None have to document what that UI displays. If you want the image to be viewed in a gallery-style app, get it indexed by the `MediaStore`, using `MediaScannerConnection`. Whether that will help with your specific device's camera app, I cannot say. – CommonsWare May 08 '17 at 15:35
  • Ok. Thank you for both of your suggestions. – user3796320 May 08 '17 at 19:35

0 Answers0