Workaround for keeping NotificationListenerService alive
<p>This is a <a href="https://code.google.com/p/android/issues/detail?can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&amp;groupby=&amp;sort=&amp;id=62811" rel="nofollow">known bug</a>. </p>

<p>NotificationListenerService gets killed during app updates and sometimes even randomly and it isn't restarted automatically. Further, it can't even be started manually but we have to prompt the user to reboot the device, since the service only seems to be able to be started on device boot.</p>

<p>The following doesn't work (trying to start the service manually):</p>

<pre><code>    startService(new Intent(this, NotificationService.class));
</code></pre>

<p>Are there any workarounds for this? I need the service to be constantly running and getting the OnNotificationPosted events.</p>