Dear board,
the resuming-function on my Nexus One drives me crazy…
Whenever the Android-App is started, the hintergrund.jpg-image gets displayed. If I exit using the Home-button, I may restart the App instantaneously. If I use the Back-Button to leave the App, and restart it a few seconds later, the screen turns black in 9 of 10 starts…
It does not matter, if the WebPopup is used, or not. You may use an empty ad.html for testing.
Please someone have a look at this Code:
[lua]local function onSystemEvent( event )
if ( event.type == “applicationExit” ) or ( event.type == “applicationSuspend” ) then
native.cancelWebPopup()
hintergrund:removeSelf ()
Runtime:removeEventListener( “system”, onSystemEvent )
end
end
function showAd(event)
– Is the url a remote call?
print(“url” … event.url)
if not string.find(event.url, “ad.html”, 1, false) then
system.openURL(string.gsub (event.url, “Corona:”, “”))
else
print(“loading an ad”)
return true
end
end
hintergrund = display.newImage( “hintergrund.jpg” )
native.showWebPopup(0, 432, 320, 48, “ad.html”, {baseUrl = system.ResourceDirectory, hasBackground = false, urlRequest = showAd})
Runtime:addEventListener( “system”, onSystemEvent )[/lua]
[import]uid: 10612 topic_id: 11790 reply_id: 311790[/import]