I have a bug that drive be crazy for 3 days. What im trying to do is show a notification on the notification bar, which is very simple, this is the code:
private void sendNotification(String msg) {
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, MainActivity.class), 0);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("hello")
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(msg + "1"))
.setContentText(msg + "2");
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
In most of the devices is it working ok, but on some devices (like galaxy1, android 4.1.2) it does not show the notification.
What else is weird is that when i write a simple application with this code it works, but when i put this code in my application (which is almost ready for production and has a lot of modules) it does not show the notification on the notification bar.
Please help, any ideas?