java - update notification text every second -


I want to update every notification text I have written this code

  New handler () Post Delayed (New Runnabel) {@Override public void run () {// TODO Auto-Generated Method Stub Builder.SetSamLicon (R.drawable. IC_Luncher); Builder.Sent ContentTitle ("text"); Builder.ContentText ("Value updated every 1 second");}}}, 1 * 1000);   

But the price is not updated every 1 second, but only once. Why? How can I do this?

His code starts a thread that sleeps 1000 milliseconds each round.

  Thread T = New thread () {@ Override Public Wide Run) {try {while (! Interrupt ()) {Thread.sleep (1000); RunOnUiThread (New Runnabel) {@ Override Public Wired Run ()} // // Update Text Here!}}); }} Grip (interrupted e) e} {}}}; T.start ();    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -