Android Wear Notification

I want my notification to appear on top of the entire existing notification stack on the Android wear device. I read the documentation, Google says that we should use the setPriority () method for this notification to change the position of the notification in the statck notification. I executed the notification as follows:

NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
            .extend(wearableExtender)
            .setContentTitle(getSpannableTitle(flightDto.getFlightName()))
            .setContentText(getSpannableContentText(flightDto, color, status))
            .setPriority(NotificationCompat.PRIORITY_MAX);

But this code is not needed, if the calendar notification is on top of all, my notification appears under the calendar notification. How do I show this notification on top of all notifications?

+4
source share
2 answers

, setPriotity, setVibrate. :

NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
            .extend(wearableExtender)
            .setContentTitle(getSpannableTitle(flightDto.getFlightName()))
            .setContentText(getSpannableContentText(flightDto, color, status))
            .setPriority(priority)
            .setVibrate(new long[]{1000, 1000, 1000, 1000, 1000});
+10

setOngoing. API doc : " ".

+1

All Articles