1

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();

},
Falko
  • 17,076
  • 13
  • 60
  • 105
Sean
  • 11
  • 4
  • 1
    Just one thing that doesn't answer the question at all but that you need to do is to destroy the actionsheet after you hide it otherwise everytime the onSelectImageCommand functionction will be called then a new action will be created without being destroyed. – Titouan de Bailleul Sep 06 '12 at 19:53

0 Answers0