I have an IntentService and I want to make it sticky with an ongoing notification. The problem is that the notification appears and then disappears immediately.
This should not be an IntentService. As written, your IntentService will live for a millisecond or so. Once onHandleIntent() returns, the service is destroyed. This should be a regular Service, where you fork your own thread and manage the lifetime of the thread and the service.
The reason your Notification is going away immediately is because the service is going away immediately.