6

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.

Community
  • 1
  • 1
nAkhmedov
  • 3,522
  • 4
  • 37
  • 72
  • 11
    I have tried this now and what I can come up with is that you does not disable Show notification on the right app. You disabled notifications on the app DU Speed Booster and what i can see is DU Battery Saver is another app meaning you must disable notification for that app instead. – Johan Lindkvist Jul 31 '15 at 12:13

3 Answers3

4

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)

Community
  • 1
  • 1
maysi
  • 5,457
  • 12
  • 34
  • 62
0

Can you try by setting the priority to MAX?

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());
Garry
  • 4,493
  • 3
  • 28
  • 48
0

Its not possible to get Notification for app if user turned it off. Android did not exposed any api to control iit too.

Zoombie
  • 3,590
  • 5
  • 33
  • 40
  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – jedrzej.kurylo Aug 01 '15 at 13:24
  • I understand, **but Its not possible to get Notification for app** itself is an answer. – Zoombie Aug 23 '15 at 13:41