Fix #927 - IllegalStateException in notifications

Fix #927 - I'm pretty certain this was already fixed in v2.6.1, but I added a hasActivity() check just to be safe.