android - Service restarts when killing activity process -


i have activity starts service in seperate process via android:process attributes of service.

my service's onstartcommand() function returns start_sticky.

i kill activity's process through swiping away via recent apps button, , service process restarts.

i want know if there way keep service running when activity process killed.

i want know if there way keep service running when activity process killed. 

no, there no way keep service running. because,

closed user via running services screen in settings.  closed user via task killer.  closed android free memory in times of need. 

keep service running bad idea.

but can do,

--> can restart service using broadcast receiver.(when incoming call, boot complete, sms received.. etc, use depend on requirement)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -