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

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

google app engine - 403 Forbidden POST - Flask WTForms -