Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing toast from package in Android

I'm developing an Android app and I'm trying to show some information with a Toast. I used Toasts 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.

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();

I tried to set the context with getApplicationContext() and getBaseContext() too, but doesn't work.

Anyone knows how to solve this problem?

Thank you very much.

like image 780
xpaterna Avatar asked Jul 19 '12 19:07

xpaterna


1 Answers

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.

like image 104
fabzy Avatar answered Oct 04 '22 03:10

fabzy