Android Question Notification and "Unfortunately System UI has stopped"


Well-Known Member
Licensed User
Hi there...

I am using notifications... much time... but in some devices always changing... things to work or not...

Is there a way to all work with the same... steps ?

I am using b4a v9...

code example:
at... main at top... i have:

into service i have:

Sub CreateNotification (Body As String) As Notification
    Dim notification As Notification
    notification.Icon = "icon2"
    notification.SetInfo("some info...", Body, Main)
    Return notification
End Sub

i am calling that from:
Sub Service_Start (StartingIntent As Intent)
   If Main.manager.GetBoolean("check1")=True Then
       Service.StartForeground(1, CreateNotification("..."))
   End If
That example... may be work... may be not....

At android ver 4.4.2 in some devices working... at other give: Unfortunately System UI has stopped
At android ver 6,7 works perfect...

Is there a way that will work in any version... ?


Well-Known Member
Licensed User
...@Erel ...usually the createnotication running only one time...

for other notifications i am using different ids... like this - for those need to cancel them ? :

Sub ccn(text As String)
    cn.Icon = "icon2"
    cn.Sound = False
    cn.Vibrate = False
       cn.SetInfo("blah blah blah ", text & " " & CRLF & DateTime.Date(DateTime.Now), Main)
End Sub
Sleep not acceptable - is for call blocking...


Well-Known Member
Licensed User
@Erel... i am not saying that sleep is blocking... app is for call blocking ... so if use in middle the sleep perhaps 100ms i will loose a call identification / so will not block it :)

Icon... What's the best icon size (kb) height/width ? mine is just white and black and about: 300x300 pixels... 47kb... is it big... ?


Licensed User
Yes but i don't want the phone start ringing - i want to be fast..
1. Did you TRIED it?
2. WHERE did you stated this requirements? The thread is about that notifications are not working for you. No word about the fact what you are really trying to archieve.

Good luck. I´m out here.


Well-Known Member
Licensed User
Icon Seems have problem... notification icon (it's icon2) is ok because it is black/white colors... but the icon at scrolled notification is circle solid grayed... Icon of app (icon) is perfect...

in some androids... version 5 - the scrollabe notification icon is solid-gray with 3 white lines vertically from top to center...



Well-Known Member
Licensed User
I am saying... that:

icon.png ---> work ok ---> as icon for app at desktop of android...
icon2.png ----> works ok ---> as notification and i am using it...

but when phone is locked or when i scroll notifications - don't know exactly what icon is used and get a gray circled icon... "i want to change that icon at this view"

... the BaN BaNk... icon...