小编Edw*_*Toh的帖子

相机捕获图像后,Phonegap应用程序退出.[Android]产品

我在Phonegap 1.4.1中遇到错误.

我创建的phonegap应用程序在拍完照片后返回应用程序后重新启动.

这是我正在使用的代码:

function capturePhoto() {
  // Take picture using device camera and retrieve image as base64-encoded string
  navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI });
}

function onPhotoURISuccess(imageURI) {
  // Uncomment to view the image file URI 
  // console.log(imageURI);

  // Get image handle
  //
  var largeImage = document.getElementById('largeImage');

  // Unhide image elements
  //
  largeImage.style.display = 'block';

  // Show the captured photo
  // The inline CSS rules are used to resize the image
  //
  largeImage.src = imageURI;
}
Run Code Online (Sandbox Code Playgroud)

camera android cordova

16
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

camera ×1

cordova ×1