When opening the image gallery sometimes the application crash and sometimes it doesn't. It shows a java exception but no meaningful message.
Does anyone have a idea? I also used intents but cant get it to work.
Thnxs!
Here a sample of my code:
Here a sample of my code:
function openGallery() {
var popoverView;
var arrowDirection;
if(Titanium.Platform.osname == 'ipad') {
// photogallery displays in a popover on the ipad and we
// want to make it relative to our image with a left arrow
arrowDirection = Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT;
popoverView = imageView;
}
var image = undefined;
Titanium.Media.openPhotoGallery({
success : function(event) {
var cropRect = event.cropRect;
image = event.media;
// set image view
Ti.API.debug('Our type was: ' + event.mediaType);
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
addAttachment(image);
} else {
// is this necessary?
}
},
cancel : function() {
},
error : function(error) {
},
allowEditing : true,
saveToPhotoGallery : true,
popoverView : popoverView,
arrowDirection : arrowDirection,
mediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO]
});
}