Marcos Guimaraes
Marcos Guimaraes

Reputation: 1295

removing intermediary screen with picture

I am using this method to open my camera and take a picture:

public static void openCamera(Fragment fragment, Uri fileUri) {
      Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
      takePicture.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
      takePicture.putExtra("return-data", true);
      if(takePicture.resolveActivity(fragment.getContext().getPackageManager())!=null){
        granUriPermission(fragment.getContext(), fileUri, takePicture);
        fragment.startActivityForResult(takePicture, Constants.Intents.INTENT_IMAGE_CAMERA);
      }else{
        Toast.makeText(fragment.getContext(), R.string.error_no_camera_app, Toast.LENGTH_SHORT).show();
      }
    }

Right after I take the picture I get this screen where I am asked if I want to keep or delete the picture I just took:

enter image description here

What is this screen?

Can I force its orientation to be in the landscape mode?

Can I remove this extra step/screen and go straight to my fragment where I show the picture?

Upvotes: 0

Views: 45

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

What is this screen?

It appears to be a confirmation screen.

Can I force its orientation to be in the landscape mode?

No, because that is not from your app. It is from one of hundreds of different camera apps that might be started via your ACTION_IMAGE_CAPTURE Intent.

Can I remove this extra step/screen and go straight to my fragment where I show the picture?

Probably not. You are welcome to contact the developers of that camera app and ask them, but their solution would be only for their app. It would not help you with the hundreds of other camera apps that you might encounter, across the ~10,000 Android device models and ~2 billion Android devices.

If you want complete control over the camera UX — at the cost of complexity — use a third-party camera library (e.g., CameraKit-Android, Fotoapparat) that wraps around the native camera APIs (e.g., android.hardware.Camera, android.hardware.camera2.*).

Upvotes: 1

Related Questions