I think that this will never be possible, because if this happens, the function from Android will be unnecessary, because every developer can get around this. And if there was any possibility, I think the Android team will fix it very soon, because it will be a mistake.
And as mentioned in a comment from Johan Lindkvist , you turned off notifications about the wrong application.
If you still need to notify the user due to important information, you can use the Service
. Then use getApplicationContext()
to display Toast
. But you must include your application name in the message so that the user knows who sent the message. But this is not a good practice, because you should use Toast
only if the user is in your application in accordance with the recommendations:
Your application should not create a dialogue or toast if it is not on the screen. A dialog or toast should only be displayed as an immediate response to the user taking an action within your application.
( https://developer.android.com/design/patterns/notifications.html )
maysi source share