故意在Android中挂起UI线程

huangapple 未分类评论48阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年5月29日 06:24:16
  • 转载请务必保留本文链接:https://java.coder-hub.com/62075528.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定