I would that the notification does not disappear after a few seconds. So i have create the notification like this:
NotificationCompat.Builder builder = new
Duration of heads-up notification can't be changed It is set at OS level Depends on OS how much time it provides for it.