add set type start service (START_STICKY/START_NOT_STICKY/START_RED… by dvjdjvu · Pull Request #2752 · kivy/python-for-android · GitHub
Skip to content

add set type start service (START_STICKY/START_NOT_STICKY/START_RED…#2752

Open
dvjdjvu wants to merge 1 commit into
kivy:developfrom
dvjdjvu:start_type_service
Open

add set type start service (START_STICKY/START_NOT_STICKY/START_RED…#2752
dvjdjvu wants to merge 1 commit into
kivy:developfrom
dvjdjvu:start_type_service

Conversation

@dvjdjvu

@dvjdjvu dvjdjvu commented Feb 17, 2023

Copy link
Copy Markdown

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.

@dvjdjvu

dvjdjvu commented Mar 7, 2023

Copy link
Copy Markdown
Author

@RobertFlatt

Copy link
Copy Markdown
Contributor

@kuzeyron kuzeyron added the core-providers Core code that's not a recipe label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-providers Core code that's not a recipe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants