我尝试旋转相机时的Android消息

时间:2013-11-23 04:39:51

标签: android android-camera

当我尝试在相机预览处于活动状态时在手机上将屏幕从横向旋转为纵向或反之亦然,它会在Logcat中显示以下消息:

 Error while configuring rotation 0x80001005
 ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning  
 error: 0x80001005 - Error returned from OMX API in ducati

2 个答案:

答案 0 :(得分:0)

旋转屏幕时,您可以编写自己的吐司:

@Override
        public void onConfigurationChanged(Configuration newConfig) {
            super.onConfigurationChanged(newConfig);

            // Checks the orientation of the screen
            if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
                Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
            } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
                Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
            }
        }

答案 1 :(得分:0)

只是一个疯狂的猜测:是否有可能将旋转设置为不是90°的倍数?

试试这个:

    if (portrait) {
        params.set("orientation", "portrait");
        camera.setDisplayOrientation(90);
    } else {
        params.set("orientation", "landscape");
        camera.setDisplayOrientation(flipped ? 180 : 0);
    }
    camera.setParameters(params);