If the following is how you start an android service with Kivy, how do you stop a service from the front end? I already know how to make the service stop itself in the service, i want to stop it from the frontend:
from android import AndroidService
service = AndroidService('myApp', 'status: active')
service.start('service started')
self.service = service
I tried the following but it does not work:
from jnius import autoclass
service = autoclass('org.renpy.android.PythonService').mService
service.stopService()
If you use python-for-android's newer services api, which I recommend, you can manage the service via pyjnius as follows:
If using the old way with the android module (which isn't that well supported right now), it looks like you should be able to call
service.stop()
on your AndroidService object.