I am trying to fix four buttons always at the top of notification bar that cannot be closed. The buttons will be fixed all the time when the application is launched for the first time. For this purpose I am creating notification through Notification Builder as follows.
Notification notification = new Notification.Builder(this).build();
notification.flags = Notification.FLAG_ONGOING_EVENT;
notification.icon = R.drawable.ic_launcher;
notification.contentIntent = pendingIntent;
notification.setSmallIcon = R.drawable.ic_launcher;
notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
notification.priority = Notification.PRIORITY_HIGH;
mNotificationManager.notify(Constants.NOTIFICATION_ID_BRANDING, notification);
Everything works fine and I could even able to show my notification on top but whereas while I receive some other notification from different application my notification is showing below that application.
The line notification.priority = Notification.PRIORITY_HIGH;
does the thing but it is specific only for our application.
My Requirement: But my requirement is to keep my notification always on the top irrespective of any notification. Please help me with your tips and solutions. Thanks in advance.