错误'相机已取消' - 应用程序Sencha与PhoneGap [英] Error 'Camera Cancelled' - App Sencha with PhoneGap

查看:228
本文介绍了错误'相机已取消' - 应用程序Sencha与PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,你用手机拍照并发送到社交网络。
我的应用程序是用sencha touch 2和Phonegap开发的。
当我尝试拍照,我的应用程序重新启动,并给我一个错误相机取消。
我试试看console.logs,但它们不出现...

I'm developping an app that you take pictures with phone and send to social networks. My App is developped with sencha touch 2 and Phonegap. When i try take a picture my app restarts and give me a error 'Camera cancelled'. I try see console.logs but they don't appear...

这是我的代码:

function uploadPhoto(data){
                // this is where i will send the image file to server
                //output image to screen 
                    console.log(data);
                }
    function fail(msg){
                    alert(msg);
                }
    navigator.camera.getPicture(uploadPhoto, fail, {
                    quality : 30,
                    destinationType: Camera.DestinationType.DATA_URL 
                });</i>


推荐答案

我正在使用Android的cordova v2.6。

Same error here. I'm using cordova v2.6 for Android.

为了解决它,我不得不编辑 AndroidManifest.xml 并将DroidGap活动启动模式从singleInstance更改为standard。

To solve it I had to edit the AndroidManifest.xml and change the DroidGap activity launch mode from "singleInstance" to "standard".

这篇关于错误'相机已取消' - 应用程序Sencha与PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆