Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a notification with saved icon

In my application the user pick an application from list of applications installed on their phone.

I want to create a notification with an icon of the choosen application.

The problem is that I can't save the icon inside my application, and if I save it somethere else I won't be able to get the icon by id, as it needed to create a notification.

How can I solve this?

like image 664
user2287757 Avatar asked Nov 29 '25 04:11

user2287757


1 Answers

you can not add or edit the resource of res folder. And as the main icon of notification is provided as an icon id so you can not change by dynamic images from program. But there is another icon option in the notification. it is a small icon (althgouh it is called large icon!! dont know why) at the right side of the notification. you can set it by sending Bitmap as parameter.

you can see the look of this icon in this link. see the number 6 of normal view.

To set this icon you can use setLargeIcon method.

like image 110
stinepike Avatar answered Nov 30 '25 18:11

stinepike



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!