Notification: Sony Devices Do Not Show Any Notification
I use these lines of code for showing notification in my app but sony devices(xperia p, sola, acro s) does not show any notification. I dont have any problem with other android dev
Solution 1:
This is my onRecieve from a Broadcast, it makes notifications on xperia, i havent had any device problems with it you can chop it up if it works for you
@OverridepublicvoidonReceive(Context arg0, Intent arg1) {
Stringkey= LocationManager.KEY_PROXIMITY_ENTERING;
Booleanentering= arg1.getBooleanExtra(key, false);
Stringhere= arg1.getExtras().getString("alert");
Stringhappy= arg1.getExtras().getString("type");
NotificationManagernotificationManager=
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntentpendingIntent= PendingIntent.getActivity(arg0, 0, arg1, 0);
Notificationnotification= createNotification();
notification.setLatestEventInfo(arg0,
"Entering Proximity!", "You are approaching a " + here + " marker.", pendingIntent);
notificationManager.notify(NOTIFICATION_ID, notification);
}
private Notification createNotification() {
Notificationnotification=newNotification();
notification.icon = R.drawable.icon;
notification.when = System.currentTimeMillis();
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.defaults |= Notification.DEFAULT_VIBRATE;
notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.ledARGB = Color.WHITE;
notification.ledOnMS = 1500;
notification.ledOffMS = 1500;
return notification;
}
//make actions
}
it doesnt use Builder idk exactly what is causing your problem, i know this works on xperia though
Post a Comment for "Notification: Sony Devices Do Not Show Any Notification"