2

Tried every possibility to set small icon in status bar(which would get carried on by system as large icon in opened notification drawer) but nothing is working. Tried using raw .png file as well as drawable .xml files and combination of both(xml's referring to png as source of bitmap).

Also, I did add resource using AndroidStudio New -> Image Asset -> Notification icon which gracefully converted it to required versions and stripped from all colors except white and alpha channel.

No matter what I do the default launcher icon is displayed instead of my own.

ilmash
  • 174
  • 2
  • 12

1 Answers1

4

The answer is short and simple: Reboot your phone!

MIUI caches notification icons and after installing application they are not updated along with app updates(often during developing cycle). Also uninstalling and installing again does not resolve the problem. The only way in this case was to reboot the phone.

I also suspect MIUI theme manager which may be responsible for this as I saw some themes changing app icons system-wide, so it may probably bypass any settings made in Notification.Builder. On top of that, any of the tricks like changing resources in RemoteView of built notification also does not work. Beware of MIUI!

ilmash
  • 174
  • 2
  • 12
  • whole day I am struggling to change the icon and just now I found that answer. It is also valid for Meizu – kpacn Nov 23 '16 at 11:32
  • If this persists over boot, then it's the theme manager. Just change the theme, or if the phone is rooted, search for your package name under /data and delete the cached files. – grebulon Oct 25 '18 at 15:02