Sunday 15 June 2014

android - Strange Thread.sleep behaviour -


So I want to wait 60 seconds before uploading the file to the server and here is my "wait" code:

 try  {log (i.e., "waiting for 1 minute before uploading"); For (int i = 0; i <60; i ++) {debug.log ((60 - i) + "seconds remaining ..."); Thread.Sleep (1000); }} Grip (Interrupted e) e.printStackTrace (); }   

And I'm left for 13 seconds. It is always stuck on "13 seconds left ..." after waiting for 1 hour! Any help with this please?

The BitDebug.log is similar to Log.i, except that it adds the array to the array list as well.

try using the termatask class ITEAD < P> In this wait (tall millisecond) method and applies runner which you can use as a thread.

or the timer class can also help you.

here

No comments:

Post a Comment