Copy link to clipboard
Copied
Hello, I'm trying to use the CameraRoll to access photos on a Galaxy S5 Android device. I'm using the latest version of AIR from the labs.
When I browse for a photo, everything seems to be working correctly, it gives me the options of where to chose from then shows the photos. But anytime I choose a photo, the "ErrorEvent.ERROR" is dispatched and I see the message.
"ERROR #2124: Loaded file is an unknown type."
Has anyone else ever had this problem before? Pretty straight forward code but just doesn't work for me.
if(CameraRoll.supportsBrowseForImage){
var camera:CameraRoll = new CameraRoll();
camera.addEventListener(MediaEvent.SELECT, _onSelect);
camera.addEventListener(Event.CANCEL, _onCancel);
camera.addEventListener(ErrorEvent.ERROR, _onError);
camera.browseForImage();
}
private function _onSelect($event:MediaEvent):void{
trace("selected");
}
private function _onCancel($event:Event):void{
trace("cancelled");
}
private function _onError($event:ErrorEvent):void{
trace("this always fires", $event.text);
}
turns out I was missing <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
sorry for the spam... please continue on
Copy link to clipboard
Copied
turns out I was missing <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
sorry for the spam... please continue on