add set type start service (START_STICKY/START_NOT_STICKY/START_RED…
I added choice type start service START_STICKY, START_NOT_STICKY and START_REDELIVER_INTENT. Default use now and before START_NOT_STICKY, but when you close app, service close too.
And I used this code for restart service.
PythonService = autoclass('org.kivy.android.PythonService')
PythonService.mService.setAutoRestartService(True)
Now you can use
PythonService.mService.setTypeStartSticky()
PythonService.mService.setTypeStartNotSticky()
PythonService.mService.setTypeStartRedeliverIntent()
With setTypeStartNotSticky, service doesnt close when app swipping or close.
Hello @misl6, can you look this? I create 2-nd pull request.
FYI the proposed change is overridden by https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/bootstraps/common/build/templates/Service.tmpl.java#L9-L14 (which also provides service persistence control from buildozer.spec :foreground:sticky).