I am developing an application for Android using PhoneGap (Cordova 1.6.1). My application crashes when I invoke the camera API and I am getting log messages like “showStatusIcon on inactive InputConnection”. I have used the following methods to invoke the camera:
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);
}
I have used it like this and it is working fine for me. Please check –