4
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra("android.intent.extras.CAMERA_FACING", 1);

    startActivityForResult(intent, CAMERA_REQUEST);

My code is this above, my device is LG Nexus 4 with 4.4.2.

Intent starts with back camera always. I try to change number with 0,1,2 but same result. how can i do?

Thanks

Danilo
  • 199
  • 1
  • 2
  • 12

1 Answers1

3

Officially, there's no intent that targets the front-facing camera. Your code might work on some phones, though. See here for more details

Community
  • 1
  • 1
nickofbh
  • 46
  • 5
  • 1
    But the official solution is users that choose right camera every time? – Danilo Jun 25 '14 at 15:46
  • 4
    @Danilo: The "official solution" is that you should not care what camera is used. It is up to the third-party camera app that you are invoking, and the user, to determine what camera will be used. – CommonsWare Jun 25 '14 at 15:57
  • There is a problem with not knowing which facing is used. Image we get in result is always rotated 90 or -90 degrees depending on camera facing used. – Harshil Pansare Dec 06 '18 at 10:56