Android service onCreate is called multiple times without calling onDestroy

后端 未结 3 1183
说谎
说谎 2020-12-03 00:07

In my app, I use a service to communicate with our server. The Service spawns several message queue threads to deal with tasks with different priorities.

This model

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 00:24

    I had the same problem when my service used the same process with activities(default). but no more problems when I made my service use another process. I edited my AndroidManifest.xml like below... (added android:process attribute)

    
    
    

    see http://developer.android.com/guide/topics/manifest/service-element.html for information.

提交回复
热议问题