|
本帖最后由 hkhl 于 2017-7-18 10:00 编辑
android 7调用相机失败,但是可以录像。第一次打开闪退,后面重新打开显示调用失败!!
android 6调用没有问题。
//拍照
Model.prototype.cameraBtnClick = function(event) {
var operateLabel = this.getElementByXid("operateLabel");
var resultLabel = this.getElementByXid("resultLabel");
$(operateLabel).text("开始拍照!");
$(resultLabel).text("");
var data = this.comp("fileData");
function onSuccess(imageURI) {
debugger;
data.newData({index : 0});
data.setValue("filePath", imageURI);
data.setValue("fileName", imageURI.substr(imageURI.lastIndexOf('/') + 1));
data.setValue('createTime', justep.Date.toString(new Date(), justep.Date.DEFAULT_FORMAT ));
$(resultLabel).text("成功1"+imageURI);
}
function onFail(message) {
$(resultLabel).text("失败:"+message);
}
navigator.camera.getPicture(onSuccess, onFail, {quality : 50});
}; |
|