So it turns out that Huawei phones with 5.1 can't display MediaStyle
notifications so while fixing that, I made a very simple notification test and I get a strange question asking Allow App Name to push messages to the notification panel
.
I don't use push in any way, in fact the screenshot below is for an app that all it does is show a sample notification, nothing else.
How can I make it not show that?
This is the code:
Notification notification = new Notification.Builder(getApplicationContext())
.setSmallIcon(R.drawable.ic_launcher_background)
.setContentTitle("Track title")
.setContentText("Artist - Album")
.setOngoing(true)
.addAction(R.drawable.ic_add_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_android_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_archive_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_arrow_back_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_aspect_ratio_black_24dp, "fwd", pi)
.addAction(R.drawable.ic_fast_forward_black_24dp, "fwd", pi)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.vectors_525058875))
.setAutoCancel(false)
.build();
notificationManager.notify(300, notification);
This is the screenshot.
What am I doing wrong? I tried taking out all the actions, that didn't help. Took out title and context, that didn't help. Took out large icon, auto cancel, ongoing, etc, didn't help.
Please note that I am not using Push in any way and this doesn't seem to be related to that. Also I a using the support compat libraries to make my notification but on this example I didn't just to make sure that wasn't the issue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…