How to use Thread.sleep() in this example in android -


i have example code on main thread:

userbutton.setonclicklistener(new view.onclicklistener()     {         public void onclick(view v)         {             simplemessage.settext("msg1");              try {                 thread.sleep(1000);             } catch (interruptedexception e) {                 e.printstacktrace();             }              simplemessage.settext("msg2");              try {                 thread.sleep(1000);             } catch (interruptedexception e) {                 e.printstacktrace();             }              simplemessage.settext("msg3");         }     }); 

the problem updates text "msg3" after amount of time. why happening , how make update @ every message?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -