网上文章都说这样调用:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra("camerasensortype", 2); // 调用前置摄像头
测试,发现不正确,并不能直接打开前置摄像头,打开的是上次使用的摄像头。正确方法是
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra("android.intent.extras.CAMERA_FACING", 1);//前置摄像头
小米8测试可以用