I'm making a weather app.
I'm making a notification. I don't see icon and appname like the notification (weow app) at the top, and I want to create a notification with no empty space around it.
However, no matter what you do, it doesn't come out like that, and it can be minimized/maximized like the second notification (notification of the app I created), and the notification is generated so that you can see the icon and appname.
I looked it up and said that the priority of the notification should be the highest priority, or that the value of setWhen should be set to zero when the notification is generated, but it doesn't work at all.
How can we create custom notifications that are always maximized?
That's the same question as this.
This is my code.
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT).setVibrate(new long[]{0L}).setDefaults(NotificationCompat.DEFAULT_LIGHTS |
NotificationCompat.DEFAULT_SOUND).setSound(null).setSilent(true).setOngoing(true)
.setSmallIcon(icon).setCustomContentView(remoteViews)
.setStyle(new androidx.media.app.NotificationCompat.DecoratedMediaCustomViewStyle())
.setCustomBigContentView(remoteViews).setShowWhen(false).setAutoCancel(false);
Notification notification = builder.build();
android
I solved it myself in a week. The build sdk version was the problem I've been working with sdk at 31, but I tried 30 just in case and it worked out.
554 Uncaught (inpromise) Error on Electron: An object could not be cloned
555 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
782 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
557 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.