Spinner object doesnt spin while loading?

So apparently this doesn’t work

spinner:start()

– load something heavy here –

spinner:stop()

The spinner doesn’t spin at all, I think it’s because it’s in the same thread? Unlinke setActivityIndicator which runs on its own thread.

Then what’s the point of having a spinner widget if they can’t play/show progress while doing something else?
Might as well load an image and then rotate them manually?

Or am I using it wrong?

Well that’s the nature of single thread code. Unless you give the app chance to update it will not.

You can read a corona staff member comment on this here: http://forums.coronalabs.com/topic/34422-what-is-it-for-a-spinner/

The only way of getting this to work better (and that doesn’t mean good) is break up your “heavy code” and call chunks of it in timer.performWithDelay with a 1 ms delay. That should let the app update the screen, but it will take some experimenting and code profiling to get the best results.

Well that’s the nature of single thread code. Unless you give the app chance to update it will not.

You can read a corona staff member comment on this here: http://forums.coronalabs.com/topic/34422-what-is-it-for-a-spinner/

The only way of getting this to work better (and that doesn’t mean good) is break up your “heavy code” and call chunks of it in timer.performWithDelay with a 1 ms delay. That should let the app update the screen, but it will take some experimenting and code profiling to get the best results.