Android Question SOLVED Oreo and B4A 8 notify icon is wrong

coslad

Well-Known Member
Licensed User
Longtime User
Until b4a 7.80 everything was right , but with B4A 8 and Oreo appen a strange thing :

If the service is started automaticaly at boot (start at boot option) the service notify icon is wrong , it appers the icon of application :

photo_2018-03-26_21-30-36.jpg

instead if a stop the app and restart it or if i start the app from the b4a bridge , the service is started from main activity :

B4X:
If comunicazione.avviato=False Then StartService(comunicazione)

appears the right icon :

photo_2018-03-26_21-42-51.jpg

any idea ?
 

johndb

Active Member
Licensed User
Longtime User
Until b4a 7.80 everything was right , but with B4A 8 and Oreo appen a strange thing :

If the service is started automaticaly at boot (start at boot option) the service notify icon is wrong , it appers the icon of application :

View attachment 65937

instead if a stop the app and restart it or if i start the app from the b4a bridge , the service is started from main activity :

B4X:
If comunicazione.avviato=False Then StartService(comunicazione)

appears the right icon :

View attachment 65939

any idea ?
If sdk >= 22 than the icon alpha levels are used as a mask.
See this thread https://www.b4x.com/android/forum/t...droid-7-1-but-works-on-earlier-android.86167/
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
yes SDK =23 , but here is an icon instead another and not an alpha channel issue,but I will try to set SDK =22 to see what appen
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
Hi

i solved with this :

I create a new service , this new service start at boot and call StartService(comunicazione) , in the 'comunicazione' service the #StartAtBoot is set to false.

In this way the icon is right and i can change that icon if for example the connection is lost.

But why if i set false to vibrate , it Always vibrate ?

B4X:
client.Subscribe("all/#", 1)
            client.Publish2("all/connect", serializator.ConvertObjectToBytes(currentName), 1, False)
            Notification1.Initialize2(Notification1.IMPORTANCE_HIGH)
            Notification1.Icon = "casa_conn"
            Notification1.Vibrate=False
            Notification1.Sound=False
            Notification1.SetInfo("Casa","Connesso" & (DateTime.Time(DateTime.Now)) ,Main)
            Notification1.Notify(1)
 
Last edited:
Upvote 0
Top