How to launch front camera with intent?

后端 未结 6 1694
[愿得一人]
[愿得一人] 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:42

    Try this:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
      intent.putExtra("android.intent.extras.LENS_FACING_FRONT", 1);
    } else {
      intent.putExtra("android.intent.extras.CAMERA_FACING", 1);
    }
    

提交回复
热议问题