How to run an infinite loop in Android without freezing the UI? -


i'm creating , android program needs to continuously keep sending data on bluetooth use this:

for(;;) { //send message } 

though works freezes ui , app how can implement same without freezing ui?

i sure app sending data monitor data.

put loop in asynctask, service separate thread or in thread beside activity. never heavy work, infinte loops, or blocking calls in main (ui) thread.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -