英文:
Hanging the UI thread in Android deliberately
问题
为了调试一个应用程序,我需要故意执行一些会导致UI线程挂起的任务。更具体地说,我希望出现标准的Android消息弹窗,上面写着“应用程序无响应”,在弹窗中你可以选择等待或强制关闭。
有没有一种方法可以做到这一点?我希望应用程序挂起大约2分钟左右。
英文:
To debug an app i need to deliberately, do some sort of task that would hang the UI thread. More specifically, so that the standard android message pops up saying "App is not responding" where you can either wait or force close.
Is there a way to do this? I would like the app to hang for say 2 minutes or so.
专注分享java语言的经验与见解,让所有开发者获益!
评论