开发者

Activity starts Remote service, Starts another activity and finish() initial activity. Is this a problem?

开发者 https://www.devze.com 2023-01-19 11:11 出处:网络
My initial activiy is basically a splash screen while preforming initialization and login in to network server.To save mem开发者_开发技巧ory I want to finish() the splash activity once it starts the m

My initial activiy is basically a splash screen while preforming initialization and login in to network server. To save mem开发者_开发技巧ory I want to finish() the splash activity once it starts the main menu activity. I still want the remote service to operate. Testing shows it does. But am I going to get into trouble doing this?

I know I can restart the remote from the main menu activity but I am trying to save overhead by not starting it twice. The remote service is required by the splash activity.


I don´t think you will get a problem. The service that you start with startService() will still be running and in the other activity you can use without a problem. Here is an example and some doc: http://developer.android.com/reference/android/app/Service.html

0

精彩评论

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