java - android app does not crash after 6 seconds -


i created button , placed following code in mainactivity:

public void pauseitjack(view v) {     try {         thread.sleep(16000);      } catch (interruptedexception e) {          e.printstacktrace();     }  } 

i pressed on button , did freeze ui expected, app idd not crash. though crash app after 5 second anr error...

not every device has watchdog timer set same length, , not functions have watchdog. also, sleep allows processor switch tasks, won't set off watchdog anyway. still bad idea sleep on ui thread though.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -