【发布时间】:2010-11-11 08:37:45
【问题描述】:
我遇到了一个问题,即当我从主屏幕打开我的应用程序时,无论是否是第一次,当我单击其中一个按钮以显示 toast 消息时,第一次单击按钮时都会显示 toast 消息没有出现,但它确实出现在第二次和随后的每次点击中。如果我然后回家并再次启动我的应用程序,我必须等待 2 点击才能看到敬酒。有人知道为什么会这样吗?
这就是我使用 toast 类的方式..
Context context = getApplicationContext();
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, msg, duration);
toast.show();
【问题讨论】:
-
初始化后你的应用程序还在做什么?
标签: java android eclipse mobile-phones toast