How to launch front camera with intent?

后端 未结 6 1721
[愿得一人]
[愿得一人] 2020-11-27 18:47

I\'m using an intent to open the camera with the native application:

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

    Uri photoUri = Uri         


        
6条回答
  •  天命终不由人
    2020-11-27 19:32

    Word of caution: its a hack

    Add this to the intent

    intent.putExtra("android.intent.extras.CAMERA_FACING", 1);
    

    This solution isn't sustainable, its using a testing code of the Camera app. For more info look at the "getCameraFacingIntentExtras" static method in Util class of the AOSP Camera project.

    Update: Looks like that it was disabled in L

提交回复
热议问题