在AndEngine场景干杯 [英] Toasts in AndEngine Scenes

查看:212
本文介绍了在AndEngine场景干杯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是现场管理和我有不同的等级从中用来显示不同​​模式的场景延伸。
我得到的概率在敬酒的消息。
在我的模式1类从现场延伸我想显示敬酒消息,但它给错误
不能创建内螺纹的处理程序已经不叫尺蠖。prepare()

I am using a scene manage and I have different classes extended from scene which are used to to display different modes. I am getting the prob in Toasting messages. In my Mode1 class extended from scene I want to show a toast message but it gives error that "Cant create handler inside thread that has not called looper.prepare()"

我试着做这里面的处理程序,但相同的结果。我试图让主类,但没有任何结果的静态处理程序。
任何一个可以告诉我解决?

I tried to do this inside handler but same result. I tried to make a static handler in main class but no result. Can any one tell me the solution?

推荐答案

您可以使用也以下方式创建敬酒消息。

You can create toast message using following way also.

mainActivity.toastOnUiThread("No moves available for REDO",
                Toast.LENGTH_SHORT);

这篇关于在AndEngine场景干杯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆