Loading Feedback

I have a function that takes a while to load new data and images onto the screen. I was thinking of adding some kind of user feedback to allow users to understand that the application is not lagging when in fact it is loading.

I’ve tried setting the activity indicator to true at the beginning of the function and false right after but it does not show on the device. It does however, show on the simulator.

I’ve also tried other methods like animating an actual image on the screen but that didn’t work. The application would just skip that as it was concentrating on loading the heavy data.

Is there anyway to force a function to perform something before it does the rest of its code? Do I have to nest another function inside my original function?

Is there a better way to show a loading feedback while loading in corona? [import]uid: 11917 topic_id: 11520 reply_id: 311520[/import]

Try this perhaps: http://developer.anscamobile.com/reference/index/nativesetactivityindicator [import]uid: 8782 topic_id: 11520 reply_id: 41811[/import]

I’ve tried that already. Works in the simulator but not on device. [import]uid: 11917 topic_id: 11520 reply_id: 41814[/import]

It works on iOS devices, I know it does. It might not work on Android devices, though. [import]uid: 8782 topic_id: 11520 reply_id: 41817[/import]

Sorry if I wasn’t clear.

It works yes. But inside a function as I described above. I cannot make it show right in the beginning of the function and hide right when it finishes.

Either that or I’m not doing it correctly. [import]uid: 11917 topic_id: 11520 reply_id: 41825[/import]

I just found something in the code exchange that might work. I have yet to test it, but just in case other people go through the same issue.

http://developer.anscamobile.com/code/execution-order-example-experience-non-linear-sequential-program-flow [import]uid: 11917 topic_id: 11520 reply_id: 41934[/import]