简体   繁体   English

Kivy 应用程序有什么方法可以继续在后台工作吗?

[英]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.

相关问题 有没有什么方法可以在具有大量后台进程的 kivy 应用程序上提高性能 output ? - is there any way to increase perfomance output on a kivy app with a lot of background processes? 如何使任何应用程序在 kivy python 的后台运行 - How to make any app run in background in kivy python 关闭 python kivy 上 android 中的应用程序后如何使服务继续工作 - how to make the service continue working after closing the app in python kivy on android 有什么办法可以取消 Kivy 中的 UrlRequest 吗? - Is there any way to cancel UrlRequest in Kivy? Kivy应用程序可在桌面上运行,但不能在Android上运行 - Kivy app working on desktop but not on android 如何在 kivy 应用程序中正确设置 MDLabel 的背景颜色 - How to color background of MDLabel properly in kivy app 从kivy.app导入应用程序错误,但导入kivy正在工作 - from kivy.app import App error but import kivy is working 有什么方法可以用 Kivy 捕获部分屏幕截图? - Any way to capture partial screenshot with Kivy? 我的 kivy 文件在 kivy 应用程序项目中不起作用,我安装了所有东西 - My kivy file is not working in kivy app project, i installed everything 有没有办法让 imageZMQ 使用 Kivy 在 android 上工作? - Is there a way to get imageZMQ working on android using Kivy?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM