Show notifications even if it is disabled for the app?

In my application, if the user is disabled Show the notification option. Android system deletes all my notification. But the DU Battery Saver app still shows here enter image description here

Please help me how to implement this? And I saw this link.

+5
source share
3 answers

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 )

+4
source

Can you try to set MAX priority?

 final Notification.Builder notification = new Builder(getApplicationContext()) .setContentTitle(getString(R.string.title)) .setContentText(getString(R.string.text)) .setColor(Color.parseColor(getString(R.color.yellow))) .setSmallIcon(R.drawable.ic_small) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)) .setPriority(Notification.PRIORITY_MAX); mNotificationManager.notify(Constants.NOTIFICATION_ID, notification.build()); 
0
source

It is not possible to receive a notification for an application if the user has disabled it. Android did not find any api to control iit.

0
source

All Articles