By calling Thread.sleep
on the UI thread i expect my android app to crash, but it does not.
I tried to explicitly run this on UI thread, by using runOnUiThread
but the result was the same, the app freezes but not crashing.
Should i expect the app to crash when using Thread.sleep(6000)
on the UI thread?
public class CrashActivity extends Activity {
@Override
protected void onResume() {
super.onResume();
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(50000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
}
I am trying to simulate ANR!