I am trying to show my icon's app in the notification bar of my app, but It does not appear. Only appear a gray circle.
It is a 72X72 pixels icon. I choose it in the "Poyect"--> Choose icon in the B4A tab.
I have tried put the file "read only" permison in the "\Objects\res\drawable" file, but when I do it, the icon of my app disapear.
This is my code:
B4X:
Dim n As Notification
n.Initialize
n.Icon ="icon"
n.Sound=True
n.SetInfo(Message.GetData.Get("title"), men, Main)
n.Notify(1)
I tried but the same result. I am using this code:
B4X:
Dim n As NB6
Private dibujo As Bitmap
dibujo = LoadBitmapResize(File.DirAssets, "ICONO 72 PLANO.png",72dip, 72dip, False)
n.Initialize("default", "my app", "DEFAULT").AutoCancel(True).SmallIcon(dibujo)
n.Build("myapp","text", "tag1", Main).Notify(4) 'It will be Main (or any other activity) instead of Me if called from a service.
Attached image of this. Any idea. It works like using notification object.
Yes, There is a file that is called icon.png. This file is the file that I have choose in the B4A (project -- choose icon) and it has got 624 * 610 pixels. The file that I want to show in my notification bar using NB6 has got 72*72 pixels and it is in my files tab of my poject. It is a different picture.
No. I have checked with a lot of different icons with different compositions. Now, I am using this one for test because it is the simpliest one, but it is not de definitively.
Newer versions of android simplify and decolour the icon for notifications. So a simple, plain circle is what I qould expect for the above yellow circulat object. When it be 3d or 2d.
Yes I did.
When I changed the round yellow circle icon by the other icon (the last one), the notification changed too, but in this case, it shows a gray rectangle (before it was a gray circle)
Yes, I can see that. That is why I said you would need to create it with transparent background for the letters to show.
I'm not 100% sure, but if you target a lower sdk in the manifest, to one before the notification icon display changed, it may show that icon as is, but that will come with other issues, so best not to do it.
Ok. Perfect. Thanks.
It works now. It shows a black and white image. All the things that is in colours appears in dark grey or black and the transparencies in white.