我的游戏被绘制到SurfaceView
. 我正在使用对话框作为关卡完成屏幕,但无法显示 ( Dialog.show()
)。
我不断收到以下错误:
01-30 16:45:34.425: E/AndroidRuntime(3415): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
我有一个 Game 类,它扩展了 Activity 并持有SurfaceView
. 我认为runOnUiThread()
可能是解决方案,但经过不知疲倦的搜索后,不知道如何在我的SurfaceView
.
任何帮助表示赞赏,如果需要,我会发布我的代码(只是不确定目前哪些位实际上是相关的)