我正在使用 PhoneGap (Cordova 1.6.1) 为 Android 开发一个应用程序。当我调用相机 API 时,我的应用程序崩溃并且我收到诸如“showStatusIcon on inactive InputConnection”之类的日志消息。我使用以下方法来调用相机:
function capturePhoto() {
// Take picture using device camera and retrieve image as base64-encoded string
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
destinationType: destinationType.DATA_URL });
}
function onPhotoDataSuccess(imageData) {
var smallImage = document.getElementById('smallImage');
smallImage.style.display = 'block';
smallImage.src = "data:image/jpeg;base64," + imageData;
}
function onFail(message) {
alert('Failed because: ' + message);
}