Android Resume ... user events happening before i can open DB

I’m having some trouble on some android devices and i suspect the iTouch.  When my app resumes i need to open the Database.

My resume psudo code looks like:

local function onSystemEvent( event ) ....     elseif (event.type == "applicationResume") then         native.setActivityIndicator( true )         databaseManager:setupDB()         timer.performWithDelay(500, function() logit("Resume Complete"); native.setActivityIndicator( false ) end)  

My problem is that user action on the gui can occur prior to the “Resume Complete” message

What i see is that sometimes the user is able to get touch events into the system before the DB is open.

This results in general badness … sure i can sprinkle code throughout to make sure DB is ready but that is nasty event to contemplate … i would have assumed that the resume event occurs before everything and that turning on the activity indicator would preclude user touch events.

Any insights are most welcome 

I’ve had some issues with native.setActivityIndicator before (sometimes, even though I’ve called native.setActivityIndicator(false) it would stay on screen etc.).

I turn the activity indicator on during applicationSuspend, this way I don’t get any delays/issues later on.

Have you tried that?

Gave your suggestion a go … seems significantly better.  Not sure why the Corona system is processing events prior to the system resume but your approach seems to help the cause.  I’ll test it a while to make sure holds together.

Thanks most kindly!

cheers,

m

I’ve had some issues with native.setActivityIndicator before (sometimes, even though I’ve called native.setActivityIndicator(false) it would stay on screen etc.).

I turn the activity indicator on during applicationSuspend, this way I don’t get any delays/issues later on.

Have you tried that?

Gave your suggestion a go … seems significantly better.  Not sure why the Corona system is processing events prior to the system resume but your approach seems to help the cause.  I’ll test it a while to make sure holds together.

Thanks most kindly!

cheers,

m