Search code examples
javaandroidandroid-5.0-lollipopandroid-notificationsheads-up-notifications

Extend Lollipops "heads-up" notification duration


Been trying to find a way to create a persistent heads up notification, exactly like receiving a phone call or hangouts call. Are these restricted to Google/system apps?

I've tried:

  • Updating the notification before the heads up notification is removed.
  • Setting the ongoing flag to true.
  • Setting auto cancel to false

Can't seem to find this being done anywhere.


Solution

  • It worked for me:

    • set ongoing flag to true
    • set full screen intent
    • set priority to PRIORITY_HIGH
    • set category to CATEGORY_CALL