更新时间:2023-02-19 19:08:58
You have coded in Activity, I suggest you to changed it to Android Service. A Service is a component which runs in the background, without interacting with the user.
看看Vogella的服务示例.
Have a look at Vogella's Service Example.
只需将您的活动代码转换为Android服务,它将在没有任何GUI的情况下在后台运行.
Just Convert your Activity code into Android Service and it will work in background without any GUI.