1

That's how I define a style for the notification:

NotificationCompat.BigPictureStyle notiStyle = new
                NotificationCompat.BigPictureStyle();
notiStyle.setBigContentTitle(context.getString(R.string.notification_ticker));
notiStyle.setSummaryText(title);
notiStyle.bigPicture(map);
notiStyle.bigLargeIcon(map); //map - bitmap

But the bitmap is too large, and notification shows only a piece of an image with full width and cropped by height, a large icon shows a little part in the center of the image.

Max Makeichik
  • 227
  • 4
  • 18

2 Answers2

1

use this code , it helps you :

Bitmap yourBitmap;
Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true);
Sats
  • 875
  • 6
  • 12
0

You can resize your Bitmap before setting it to the View with the following code.

Bitmap b = BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length)
profileImage.setImageBitmap(Bitmap.createScaledBitmap(b, 120, 120, false));
Supriya
  • 1,078
  • 1
  • 8
  • 16