Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Notification Icons Very Small

I'm using push notifications in my Android App. I'm using Android Asset Studio in order to generate my notification images.

However, the image is very small and I would like to fill the space of the notification area. Please se the below image:

enter image description here

You can find the notification images I'm using in my project here. (Generated by Android Asset Studio)

Code for showing notification here.

like image 509
Luis de Haro Avatar asked Oct 19 '25 16:10

Luis de Haro


1 Answers

The problem is you are only use setSmallIcon() . This icon will be displayed in status bar and as notification icon to if you do not set setLargeIcon().

Set the small icon resource, which will be used to represent the notification in the status bar. The platform template for the expanded view will draw this icon in the left, unless a large icon has also been specified, in which case the small icon will be moved to the right-hand side.

Set the LargeIcon. Use NotificationCompat.Builder instead example with Notification.Builder

Bitmap icon = BitmapFactory.decodeResource(getResources(),R.drawable.app_logo);
Notification noti = new Notification.Builder(mContext)
     .setContentTitle("Title")
     .setContentText(subject)
     .setSmallIcon(R.drawable.small_icon)
     .setLargeIcon(icon )
     .build();
like image 104
ADM Avatar answered Oct 21 '25 05:10

ADM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!