I have a expanded notification but its opening expanded form by default. How can I open notification collapsed form by default?
notification = new NotificationCompat.Builder(context, CHANNEL_ID)
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
.setContentIntent(contentIntent)
.setOngoing(true) //making fixed notification (uncancellable when we scroll)
.setOnlyAlertOnce(true) //show notification only first time
.setShowWhen(false)
.addAction(playbutton, "Play", pendingIntentplay)
.addAction(closebutton, "Close", pendingIntentClose)
.setStyle(new androidx.media.app.NotificationCompat.MediaStyle()
.setShowActionsInCompactView(0, 1)
.setMediaSession(mediaSessionCompat.getSessionToken()))
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setSmallIcon(R.drawable.logo_feelo)
.setLargeIcon(icon)
.setContentTitle(track.getTitle())
.build();
notificationManagerCompat.notify(1, notification);