user interface - Async iterative to update UI -


i have 1 problem. want update state of switch on main ui on base of receive server. know, android not allow internet connection on main thread.

so used async. unfortunately, inside of async i'm not able modify ui. asynctask "while(true)" code inside. ask server , on base of reply update ui ever , ever.

somebody can me?

thanks in advance , sorry bad english!

edit: i'm talking of android application.

asynctask has methods intended work ui, example onpostexecute. asynctask should used operations take quite few seconds , may hang other asynctasks.

do "while(true)" code inside

is not option. chatting server may want use service.

check more information processes , gotchas.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -