Android Process Priority

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.