当前位置: 编程技术>移动开发
Android 2.3.7.r1 camera录像过程中按menu菜单键时会停止录像
来源: 互联网 发布时间:2014-10-19
本文导语: Android 2.3.7.r1 按menu键时会停止录像。改成录像时按menu键不做处理,可做如下修改: 在packages/apps/CameraOpen/src/com/mediatek/camera/VideoCamera.java onKeyDown()方法中: 修改 代码如下: case KeyEvent.KEYCODE_MENU: if (mHeadUpDisplay != null && mGLRootView !=...
Android 2.3.7.r1 按menu键时会停止录像。改成录像时按menu键不做处理,可做如下修改:
在packages/apps/CameraOpen/src/com/mediatek/camera/VideoCamera.java
onKeyDown()方法中:
修改
case KeyEvent.KEYCODE_MENU:
if (mHeadUpDisplay != null && mGLRootView != null
&& !mAlertShowing && !mMediaRecorderRecording
&& mHeadUpDisplay.getWidth() != 0) {
mHeadUpDisplay.barsSwitch();
}
if (mMediaRecorderRecording) {
onStopVideoRecording(true);
return true;
} else if (event.isLongPress()) {
return true; // consume long press to prevent soft keyboard
}
break;
为:
case KeyEvent.KEYCODE_MENU:
if (mHeadUpDisplay != null && mGLRootView != null
&& !mAlertShowing && !mMediaRecorderRecording
&& mHeadUpDisplay.getWidth() != 0) {
mHeadUpDisplay.barsSwitch();
}
if (event.isLongPress()) {
return true; // consume long press to prevent soft keyboard
}
break;
在packages/apps/CameraOpen/src/com/mediatek/camera/VideoCamera.java
onKeyDown()方法中:
修改
代码如下:
case KeyEvent.KEYCODE_MENU:
if (mHeadUpDisplay != null && mGLRootView != null
&& !mAlertShowing && !mMediaRecorderRecording
&& mHeadUpDisplay.getWidth() != 0) {
mHeadUpDisplay.barsSwitch();
}
if (mMediaRecorderRecording) {
onStopVideoRecording(true);
return true;
} else if (event.isLongPress()) {
return true; // consume long press to prevent soft keyboard
}
break;
为:
case KeyEvent.KEYCODE_MENU:
if (mHeadUpDisplay != null && mGLRootView != null
&& !mAlertShowing && !mMediaRecorderRecording
&& mHeadUpDisplay.getWidth() != 0) {
mHeadUpDisplay.barsSwitch();
}
if (event.isLongPress()) {
return true; // consume long press to prevent soft keyboard
}
break;