I am working on an APP with Sencha Touch 2 and cordova2.0. After I use cordova2.0 API to call the camera on my android device, it works at the first time. However, when I close the APP and reopen again, the camera cannot be used without any error message. The APP itself is not hung and could be used as normal.
If I use android tool to terminate the APP, and it makes no good, still cannot use camera. If I uninstall the APP and reinstall it, the APP is back to normal. But, this issue remains.
I do appriciate it if any help.
onSelectImageCommand: function () {
postsController = this
var actionSheet = Ext.create('Ext.ActionSheet', {
enter: 'top',
exit: 'top',
bottom: 'none',
items: [
{
text: '相机拍摄',
handler: function () {
actionSheet.hide();
navigator.camera.getPicture(postsController.onCameraSuccess, postsController.onCameraFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
targetWidth: 120
});
}
},
{
text: '手机相册',
handler: function () {
actionSheet.hide();
navigator.camera.getPicture(postsController.onCameraSuccess, postsController.onCameraFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
targetWidth: 120
});
}
},
{
text: '取消',
handler: function () {
actionSheet.hide();
}
}
],
});
Ext.Viewport.add(actionSheet);
actionSheet.show();
},