I am creating a notification using NotificationCompat.Builder. To install most of the icon, I use this:
bob = new NotificationCompat.Builder(context)
.setLargeIcon(bm)
.setAutoCancel(true)
.setSmallIcon(R.drawable.ic_launcher256)
.setContentTitle(context.getResources().getString(R.string.app_name))
.setContentText(message)
.setPriority(Notification.PRIORITY_HIGH);
The small character displays well, but on some devices the large icon scales and therefore is cropped. On other devices (conveniently, everything I can check for) it works fine.
I do not know any restrictions on the size of this icon. It leaves the user contact list, so I can’t control what happens there, although, I suppose, I could resize / reformat it if this were a problem.
I will continue to debug this (focusing on the logic that gets the bitmap), but I thought I would ask if I missed something (un) obvious. Perhaps people can set contact photos on their devices that are not suitable for notifications without prior processing.
source
share