public static final int FLAG_ONGOING_EVENT was added in API level 1Bit 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.
1. In the MainActivity.java file, Set a New Notification Object named myNotification.
a. If API Level >10, then use Notification.Builder
b. If API Level < 11, then use Deprecated: How to Set a New Notification object
2. In the onCreate method, add the below line. This will set the myNotification flag to an ongoing event. This means the user will NOT be able to clear the notification within the notifications.
myNotification.flags = Notification.FLAG_ONGOING_EVENT;
3. Compile and run!
Next Recommended Article:
Resources:
http://developer.android.com/reference/android/app/Notification.html#FLAG_ONGOING_EVENT
http://developer.android.com/reference/android/app/Notification.html#flags