From 6c14c1cd1b6050f2a37a385b099a4420fe3f85e7 Mon Sep 17 00:00:00 2001 From: dvjdjvu Date: Thu, 16 Feb 2023 03:52:38 -0800 Subject: [PATCH] Set type start Server --- .../main/java/org/kivy/android/PythonService.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonService.java b/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonService.java index dd6f307ec7..5026ee38bc 100644 --- a/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonService.java +++ b/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonService.java @@ -39,13 +39,26 @@ public class PythonService extends Service implements Runnable { private Intent startIntent = null; private boolean autoRestartService = false; + private int start = START_NOT_STICKY; public void setAutoRestartService(boolean restart) { autoRestartService = restart; } + public void setTypeStartSticky() { + start = START_STICKY; + } + + public void setTypeStartNotSticky() { + start = START_NOT_STICKY; + } + + public void setTypeStartRedeliverIntent() { + start = START_REDELIVER_INTENT; + } + public int startType() { - return START_NOT_STICKY; + return start; } @Override