1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Notification icon getting stuck on Android 8+

Discussion in 'Android Questions' started by techknight, Jun 19, 2019.

  1. techknight

    techknight Well-Known Member Licensed User

    I am noticing a problem as more and more devices get updated with Android 8 and higher.

    The notification icon generated by my app from the services starting, is staying there. Even after I exit the app. This requires a device reboot to get rid of it.

    This only happens sometimes. But when this does happen, and Istart the App again, i will have 2 icons up there instead of 1.

    Here is my service code:
    Code:
    Sub Service_Create
        sNotif.Initialize
        sNotif.Icon = 
    "icon"
        RxTimeout.Initialize(
    "RxTimer"1000)
        RxTimeout.Enabled = 
    False
        EventTimer1.Initialize(
    "EventTimer1"500)
        EventTimer1.Enabled = 
    False
        RefreshTNC = 
    False
        serial1.Initialize(
    "serial1")
        sNotif.Sound = 
    False
        sNotif.SetInfo(
    "SCB3000","Tap to bring on top.",Main)
        sNotif.Notify(
    1
        
    Service.StartForeground(1,sNotif)
        
    Service.StopAutomaticForeground
    End Sub
    Here is my app finished code:
    Code:
    If UserClosed = True Then
            
    Dim P As PhoneWakeState
            P.ReleaseKeepAlive
            P.ReleasePartialLock
            mnuDisconnect_Click
        
    '    DisableAll
            StopService("CommEngine")
            
    StopService("ScoreEngine")
            
    ExitApplication
        
    End If
    I didnt have these issues with older android versions of course.

    I added ExitApplication, and StopAutomaticForegraound in an attempt to potentially fix the issue. But it did not

    any thoughts? Thanks.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice