问题描述
我正在开发一个应用程序,你用手机拍照并发送到社交网络。
我的应用程序是用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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!