Skip to main content

Posts

Showing posts from October, 2013

Android Notifications - lesson learned from implementation

Recently some Conf Call Dialer users asked to add notifications to the application, so (since it seems to be a good idea) I've spent few hours implementing them in the app. Everything went smoothly, except of one rather funny problem, after executing NotificationManager.notify, notifications were not showing up and I was getting all the time the following warning in the LogCat (12345 is the id assigned to the notification): notify: id corrupted: sent 12345, got back 0 My code seemed to be rather simple (mostly copy paste from the javadoc, with some app specific logic added): NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this). setContentTitle(event.subject).setContentText(event.timeFrom + " " + additionalText); // ... NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(notificationId, mBuilder.build()); Googling didn't help, so I compare