Android Question Choice Foreground or Stick Service programmable ?

kohle

Active Member
Licensed User
Longtime User
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 ?
 
Top