In my application I take a photo with a device camera, show it as a newImage “image1” and save the “image1” as a new file.
This is my code:
[lua]local onComplete = function(event)
if event.completed then
if system.getInfo( “environment” ) ~= “simulator” then
image1 = display.newImageRect(“CameraShot.jpg”, system.DocumentsDirectory, frame_image.width * 0.92 , frame_image.height * 0.92 )
image1.x = frame_image.x - 7
image1.y = frame_image.y - 8
uploadaphotoGroup:insert(image1)
timer.performWithDelay (100 , function (event) display.save( image1 ,“test_img_5.jpg”, system.DocumentsDirectory ) end)
end
end
end
local filePath = { baseDir = system.DocumentsDirectory, filename = “CameraShot.jpg” }
media.show( media.Camera, onComplete, filePath)[/lua]
But after 1 sec (when function(event) is applied in the timer.performWithDelay() row) , I receive the BLACK SCREEN, with only image1 on it, all other screen objects are not there. It happens only on Android device, on iPhone everything works fine.
What should I do wrong here? [import]uid: 172733 topic_id: 34924 reply_id: 334924[/import]