kisoft Well-Known Member Licensed User Longtime User Oct 31, 2018 #1 HI I'm testing this example, but when I click the same notification twice, the application crashes. Application failure occurs only on the SAMSUNG A5 phone (ANDROID 6.0.1) https://www.b4x.com/android/forum/threads/nb6-notifications-builder-class-2018.91819/ Code: Copy Logger połączony z: samsung SM-A500FU --------- beginning of system android.app.RemoteServiceException: Bad notification posted from package b4a.example3: Couldn't update icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=b4a.example3 id=0x00000000) visible user=0 ) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2046) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7331) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
HI I'm testing this example, but when I click the same notification twice, the application crashes. Application failure occurs only on the SAMSUNG A5 phone (ANDROID 6.0.1) https://www.b4x.com/android/forum/threads/nb6-notifications-builder-class-2018.91819/ Code: Copy Logger połączony z: samsung SM-A500FU --------- beginning of system android.app.RemoteServiceException: Bad notification posted from package b4a.example3: Couldn't update icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=b4a.example3 id=0x00000000) visible user=0 ) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2046) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7331) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Erel B4X founder Staff member Licensed User Longtime User Nov 1, 2018 #2 There are some issues with notifications on early versions of Android 6. Try to cancel the previous notification before you create a new one: Code: Copy Dim notification As Notification = n.Build(title, Content, "tag2", Me) notification.Cancel(5) notification.Notify(5) Upvote 0
There are some issues with notifications on early versions of Android 6. Try to cancel the previous notification before you create a new one: Code: Copy Dim notification As Notification = n.Build(title, Content, "tag2", Me) notification.Cancel(5) notification.Notify(5)