Do Android 1 years today found an application can also have multiple processes, here to record
Android has only one main process by default, and 4 large components are running in the same main process
However, service, broadcast, activity provider can start a new process by specifying android:process to run
A third-party library was referenced in the project, and Android.os.Process.killProcess (Android.os.Process.myPid ()) was called when exiting the application, killing the current process
And we integrated the Aurora push led to the Aurora push service also lost, the application after the exit will not receive the push
What to do, to put the Aurora push Jpushservice into a separate process to go, the above code will only kill the main process, will not kill other processes
<ServiceAndroid:name= "Cn.jpush.android.service.PushService"android:enabled= "true"android:process= ": Jpushservice" ><Intent-filter><ActionAndroid:name= "Cn.jpush.android.intent.REGISTER" /><ActionAndroid:name= "Cn.jpush.android.intent.REPORT" /><ActionAndroid:name= "Cn.jpush.android.intent.PushService" /><ActionAndroid:name= "Cn.jpush.android.intent.PUSH_TIME" /></Intent-filter></Service><ServiceAndroid:name= "Cn.jpush.android.service.DownloadService"android:enabled= "true"android:process= ": Jpushservice" ></Service>
Open DDMS can see our app now has 2 processes running, back key out of the main process to destroy, Jpushservice is still in the process
Android in-app multi-process