As the title says, when the user presses a button I want to call the media.selectphoto button
local function toSelectPhoto()
media.selectPhoto( { mediaSource=media.PhotoLibrary, listener=onComplete ,destination = { baseDir=system.TemporaryDirectory, filename=imageName, type=“image” } } )
end
local function handleButtonEvent2( evented )
if media.hasSource( media.PhotoLibrary ) then
toSelectPhoto()
else
If i make this same call(toSelectPhoto) on screen load it works fine and returns with the image. But when I make this call on the button event, after the user has selected a photo it does nothing. I am guessing it has something to do with the button listener event ending before the selectPhoto listener has saved the file? (Testing on android galaxy note 2) Thanks for the help!