从封装的Android燮pressing敬酒 [英] Suppressing toast from package in Android
问题描述
我开发一个Android应用程序,我试图表现出一些信息,以吐司
。
我用吐司
S在其他项目中,一切工作,但在这个程序中,吐司
应该出现,这不是T做到这一点,的logcat显示下一条消息:
燮$ P $按用户要求pssing从包装com.xxxxxxx敬酒。
I'm developing an Android app and I'm trying to show some information with a Toast
.
I used Toast
s in other projects and everything works, but in this app, when the Toast
should appear, it doesn't do it and Logcat shows the next message:
Suppressing toast from package com.xxxxxxx by user request.
我创建下一个code敬酒:
I'm creating the toast with the next code:
Context context = xxxxxxx.this;
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
我试着设置的背景下getApplicationContext()
和 getBaseContext()
过,但不起作用
任何人知道如何解决这个问题?
Anyone knows how to solve this problem?
非常感谢你。
推荐答案
转到您的应用程序的应用程序,信息屏(长按上的应用程序,将其拖动到Android 4.0的上方),并确保显示通知复选框被选中。否则,你的祝酒词会燮pressed。
Go to the App-Info Screen of your application ( long click on the app and drag it to the top in Android 4.0) and make sure the "Show notification" checkbox is selected. Otherwise your Toasts will be suppressed.
这篇关于从封装的Android燮pressing敬酒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!