Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - show notifications even if it is disabled for the application?

In my app if user disable Show notification option Android system removes all my notification. But DU Battery Saver app it still shows, here it is enter image description here

Please help me how to implement like this? And i have seen this link as well.

like image 445
nAkhmedov Avatar asked Jul 29 '15 06:07

nAkhmedov


People also ask

Why do I only get notifications when I open the app?

You can check notification settings from System Settings > Apps and Notifications > Apps > Messages. Then click on the Notifications option and make sure All Messages notifications is toggled on. Also, Android supports multiple channels for notifications.

How do I force notifications on Android?

Go to Settings > Apps & Notifications > enable notifications for the app.


1 Answers

I think this will never be possible because if it would, the feature from Android would be unnecessary because every developer could bypass it. And if there were any possibility I guess the Android team would fix this very soon, because it would be a bug.

And as already mentioned in the comment from Johan Lindkvist you disabled the notifications of the wrong app.

If you still need to notify the user because of some important information, you could use a Service. And then use the getApplicationContext() to display a Toast. But you should include your app name in the message, so the user knows who was sending the message. But this is no good practice because you should use Toasts only if the user is in your app according to the guidelines:

Your app should not create a dialog or toast if it is not currently on screen. A dialog or toast should only be displayed as an immediate response to the user taking an action inside of your app.

(https://developer.android.com/design/patterns/notifications.html)

like image 150
maysi Avatar answered Sep 28 '22 02:09

maysi