【发布时间】:2016-02-01 12:07:55
【问题描述】:
当我没有升级到 4.4.2 时,支持前置摄像头,屏幕以横向模式打开,但当我升级到最新版本时,摄像头不支持前置模式,它正在旋转到纵向模式。
我打开相机的源代码如下:
private void getPhotoFromCamera()
{
try
{
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra("android.intent.extras.CAMERA_FACING",1);
VisitorRegistrationFragment.this.startActivityForResult(intent,FROM_CAMERA);
}
catch (Exception e)
{
e.printStackTrace();
}
catch (OutOfMemoryError e)
{
e.printStackTrace();
}
}
谁能帮我看看如何打开前置摄像头以及如何限制摄像头只能在横向模式下打开?
【问题讨论】:
标签: android android-camera android-camera-intent