Search code examples
androidandroid-intentandroid-cameraandroid-camera-intent

Camera intent with image only option


I am trying to add camera intent to my app, I would like to give the user only option to take pictures (Not video), is there a way to hide the video button from the camera:

Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");

only disables the button but its still being shown, Thanks!


Solution

  • There are ~2 billion Android devices, spread over ~20,000 device models. Your Intent will open one of hundreds of possible camera apps, both pre-installed ones and ones that the user installs.

    There is no option with ACTION_IMAGE_CAPTURE to request that certain camera capabilities be disabled for the user. Even if there was an option, there is no requirement for a camera app to honor it.

    If you need that level of control over the camera, do not link to a camera app, but instead put camera capabilities directly in your app, either via the camera APIs (hard) or by using a library (CameraKit-Android, Fotoapparat, etc.).