K kohle Active Member Licensed User Longtime User Jun 13, 2015 #1 Is there a way that I can decide if the service will run in foreground or as sticky service ? My idea is put : #StartCommandReturnValue: android.app.Service.START_STICKY in the Service attributes and do something like this in the SERVICE_CREATE : if flg_run_foreground = 1 then Service.StartForeground(1,sNotif) end if Is this possible ?
Is there a way that I can decide if the service will run in foreground or as sticky service ? My idea is put : #StartCommandReturnValue: android.app.Service.START_STICKY in the Service attributes and do something like this in the SERVICE_CREATE : if flg_run_foreground = 1 then Service.StartForeground(1,sNotif) end if Is this possible ?
Erel B4X founder Staff member Licensed User Longtime User Jun 14, 2015 #2 You cannot change the "sticky" state at runtime. Upvote 0