PaddyBadger/watertracker — pull request #1 by niftynei (2014-03-06 03:30:01+00:00)
Title: Call notification after onCreate is called

That was a tough bug. It took me a bit to figure out. The problem was using a Context object of a Service before onCreate was called. Services are subclasses of Context, but they're null until the Service as been 'created'.

This patch should fix it. It uses startService to access the service instead of calling createNotification() directly.

To make things a bit simpler, you could move the createNotification() function into the NotificationHandler class, and call it in the place of starting the NotificationCenter service.