kyle k
kyle k

Reputation: 5522

Difference in ways of maintaining Notifications

What is the difference between the function FLAG_ONGOING_EVENT and FLAG_NO_CLEAR how do they make the Notification behave differently? Do they both make the Notification permanent.

Upvotes: 3

Views: 143

Answers (1)

Arash GM
Arash GM

Reputation: 10395

Documentation says :

FLAG_ONGOING_EVENT: Bit to be bitwise-ored into the flags field that should be set if this notification is in reference to something that is ongoing, like a phone call. It should not be set if this notification is in reference to something that happened at a particular point in time, like a missed phone call.

FLAG_NO_CLEAR :Bit to be bitwise-ored into the flags field that should be set if the notification should not be canceled when the user clicks the Clear all button.

I think in these words they have different meanings so mixing these flags will give you a permanent notification until your program process ends , if you use just FLAG_ONGOING_EVENT this cause your notification runs until your binding service like phone call ends and it's also cancelable by developer or it can be clear by user and when you mix it with the other, user can't clear it from status bar.

Upvotes: 3

Related Questions