실제로 내 활동 매니페스트이 추가 다음 줄을 해결안드로이드 응용 프로그램은 죽는다
[편집] : 나는 이미지를 저장하기 위해 노력하고있어
android:configChanges="orientation|keyboardHidden"
그러나 사진을 찍은 후 저장 버튼을 누르는 시간의 80 %가 휴대 전화 갭을 사용하여 내 안드로이드 휴대 전화로 캡처되었습니다.
나는 이것이 phonegap + android의 일반적인 문제인 것으로 나타났습니다. . 나는 이미 이미지의 품질을 낮추고, 전화 메모리를 청소하고, 앱의 캐시 디렉토리를 지우려고 시도했다 ... 지금까지 아무 것도, 나는 여전히이 임의의 동작을 얻는다.
imageData와 imageURI를 사용해 보았지만 여전히 오류가 발생합니다.
주의 할 점은 휴대 전화를 돌릴 때마다 내 앱이 죽는다는 점입니다. 때로는 이미지를 저장할 때 화면이 자동으로 회전하고 앱을 종료합니다. 여기
그렇지 않으면 다시이 문제로 실행하겠습니다 ... 당신보다 당신의 mainfest에 더 추가 할 필요가 // Called when a photo is successfully retrieved
//
function onPhotoURISuccess(imageURI) {
// Uncomment to view the image file URI
// console.log(imageURI);
$('#my_div') // this div belongs to my html markup (see bellow)
.empty()
.append(
$('<image>')
.attr('src', imageURI)
.attr('width', '100')
.attr('height', '100')
.css({
'background-color' : 'red',
'-webkit-border-radius': '15px',
'-moz-border-radius': '15px',
'border-radius': '15px'
})
);
}
// A button will call this function
//
function getPhoto(source) {
// Retrieve image file location from specified source
navigator.camera.getPicture(
function (imageUri) {
onPhotoURISuccess(imageUri, photo_div_id);
},
onFail, {
quality: 30,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: source
}
);
}
<div id="my_div" class= "iconP">
<input type="button" name="photo_1" id="photo_1" onclick ="getPhoto()" value="photo 1"/>
</div>
당신이 가지고있는 해답이 도움이되지 않는다면 LogCat을 점검하고 오류가 무엇인지 알려주도록하십시오. 비트 맵이 VM 예산 유형 오류를 초과하는 경우 이는 문제의 한 종류이며, 권한 문제인 경우 완전히 다릅니다. – xbakesx