1. Foreground process
2. Visible process
3. Service Process
4. Background process
5. Empty process
Differences between new and direct threads in the service:
The new thread will be the background process directly in the activity.
Service in the new thread belongs to the process, so the background upload pictures, etc. are in the service of the new thread to do this thing
Try to keep the service in a way that doesn't die.
1.
<service android:name="com.dbjtech.acbxt.waiqin.UploadService" android:enabled="true" > <intent-filter android:priority= " "> //Set to 1000 is the highest thread priority and applies to broadcast <action android:name=" Com.dbjtech.myservice" /> </intent-filter>
2, in Onstartcommand () call Startforeground () to promote the service to the foreground process, and then OnDestroy inside call Stopforeground ()
4, in the OnDestroy to send a broadcast restart service
Stopforeground (True), and sends the broadcast
5, monitoring system broadcast Restart service
Android Process Priority