Android Question Notification and "Unfortunately System UI has stopped"

Magma

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:
B4X:
at... main at top... i have:
#additionaljar: com.android.support:support-v4

into service i have:

Sub CreateNotification (Body As String) As Notification
    Dim notification As Notification
    notification.Initialize2(notification.IMPORTANCE_LOW)
    notification.Icon = "icon2"
    notification.Sound=False
    notification.Vibrate=False
    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... ?
 

Magma

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 ? :

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

Magma

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... ?
 

DonManfred

Expert
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.
 

Magma

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...
 

Attachments

Magma

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...
 

Attachments

Top