[英]Is there any way for Kivy app to continue working in background?
I am making an android app using kivy.我正在使用 kivy 制作 android 应用程序。 I want my app should continue to run in background Even if I press minimize button of android.
我希望我的应用程序应该继续在后台运行,即使我按下 android 的最小化按钮。 Is there any way to do so??
有什么办法可以吗??
If you mean minimize the app, add on_pause function to your App class:如果您的意思是最小化应用程序,请将 on_pause function 添加到您的应用程序 class 中:
class SomeApp(App):
def build(self):
return Label(text='hello')
def on_pause(self):
return True
def on_resume(self):
#do something after reopening app
pass
But, if you mean creating background process or service that continue running even you close your app, try this .但是,如果您的意思是创建即使您关闭应用程序也继续运行的后台进程或服务,请试试这个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.