native.setActivityIndicator

Hi,
the setActivityIndicator don’t works fine… It blocks the screen but don’t show the activiti indicator.
It’s a problem only for me?

Thanks in advance
Alessandro [import]uid: 2230 topic_id: 507 reply_id: 300507[/import]

can you provide a code snippet that is giving you trouble?

Carlos [import]uid: 24 topic_id: 507 reply_id: 995[/import]

It happens only on the device, in the simulator the activity indicator show correctly.
Here the code:

function loadData(page)
native.setActivityIndicator( true )
b, c, h = http.request( “http://www.xxx.net/” … page … “.txt” )
native.setActivityIndicator( false )

end

Do you need all the code? [import]uid: 2230 topic_id: 507 reply_id: 997[/import]

My last trial day :slight_smile:
This is very important for my application, there is a solution?

Thanks
Alessandro [import]uid: 2230 topic_id: 507 reply_id: 1013[/import]

I believe this does work, but if so we need to document the workaround. Logged as bug #128 in the meantime. [import]uid: 3007 topic_id: 507 reply_id: 2004[/import]

Alessandro

still having issues?

Did your trial expired?

reach me at info @ anscamobile.com

c [import]uid: 24 topic_id: 507 reply_id: 2183[/import]

I have similar code, but opposite problem: Indicator shows, but screen is not blocked

Corona 2.0 Beta 4, iPhone 3GS, Software version 3.1.3

[lua]local rightPress = function( event )
native.setActivityIndicator( true )
end
local rightRelease = function( event )

downloadingURL = server…path…“buttons.php?user_name=”…userName

table1[1] = nil – delete 1st position of table, otherwise every new stuff goes after it!

http.request{
url = downloadingURL,
sink = ltn12.sink.table(table1),
}
native.setActivityIndicator( false )
end[/lua] [import]uid: 5394 topic_id: 507 reply_id: 3372[/import]

I had a similar problem and I think it is because you are doing it in 1 loop

if you set and remove the activity indicator in the same loop you will never see it as both those commands are processed before the screen is updated

I setup 2 functions in the end and it works as expected
function 1

  • show activity indicator
  • do http request

function 2

  • remove activity indicator

the http request needs to call function 2 when it has completed

sorry can be more helpful as away from computer but the above works (you just need to code it) [import]uid: 5354 topic_id: 507 reply_id: 3435[/import]

Makes sense @Matthew

Corona does never updates the screen while code is running.

This applies to the synchronous http request as well!

This also means that you will never get a “enterFrame” event interrupt while your code runs. Which means you do not need to lock states for changes in the stage as long as they are done in the same “event”.

I just was thinking about stuff like that because of my store / restore of the gamestate which besides of other stuffs lets the play-field uninitialized for quiet some time. I do not need to stop the “enterFrame” events for this time as I had to do for other frameworks. [import]uid: 6928 topic_id: 507 reply_id: 3436[/import]