开发者

Keep threads and views alive between Activities

开发者 https://www.devze.com 2023-01-15 18:14 出处:网络
Trying to understand the Android framework model.I have an application that needs to have several threads running.On thread gets GPS fixes, another picks up GPS fixes and pushes them to server, and ye

Trying to understand the Android framework model. I have an application that needs to have several threads running. On thread gets GPS fixes, another picks up GPS fixes and pushes them to server, and yet another occasionally polls a server for dispatched orders. Some of these threads update status Views as well.

Since I am new to Android, the application framework model hasn't clicked for me. Where are these threads started? Right now I start the threads in the initial Activity, but if开发者_如何学Python I understand it right, once that Activity goes invisible it is stopped. Furthermore, I have to track GPS and network statistics so that I can have a View which may (or may not) be the active View.

Just looking for a little guidance from folks who have tackled these issues on this platform.

Thanks.


If you are running a thread calling finish() to your activity will not stop your thread. Thread will complete in the backend and will stop automatically.

0

精彩评论

暂无评论...
验证码 换一张
取 消