Solve the problem that the Xiaomi phone cannot receive the boot broadcast

Source: Internet
Author: User
<span id="Label3"></p><p><p>Today in a push to push the time encountered a Xiaomi phone can not receive the issue of the boot Broadcast.</p></p><p><p> <span style="margin:0px; padding:0px; border:none; color:black; background-color:inherit;"><span style="margin:0px; padding:0px; border:none; Color:rgb (153, 51, 0); font-weight:bold; background-color:inherit; ">< </span> <span style="margin:0px; padding:0px; border:none; Color:rgb (153, 51, 0); font-weight:bold; background-color:inherit; ">receiver </span> <span style="margin:0px; padding:0px; border:none; background-color:inherit;">  </span> <span style="margin:0px; padding:0px; border:none; color:red; background-color:inherit;">android: Name </span> <span style="margin:0px; padding:0px; border:none; background-color:inherit;">= "com. xxxxxxxxxxx  </span> <span style="margin:0px; padding:0px; border:none; Color:rgb (153, 51, 0); font-weight:bold; background-color:inherit; ">>, </span> <span style="margin:0px; padding:0px; border:none; background-color:inherit;">   </span></span></p></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"><</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">Intent-filter</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">></span> <span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">  </span></span></p></p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"><</span></span><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">Action</span></span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;"> </span></span><span style="margin: 0px; padding: 0px; border: none; color: red; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: red; background-color: inherit;">Android:name</span></span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">=</span></span><span style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">"android.intent.action.BOOT_COMPLETED"</span></span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;"> </span></span><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">/></span></span><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">  </span></span></span></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"></</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">Intent-filter</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">></span> <span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">  </span></span></p></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;"></</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">receiver</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(153, 51, 0); font-weight: bold; background-color: inherit;">></span> <span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">  </span></span></p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);">The start-up broadcast is easy to write, as shown in the code above, but this code fails on the Xiaomi phone</p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);">In fact, it is very simple, Xiaomi mobile phone is blocked by default for all the recipients of the broadcast, you must let the user manually in the "system and Security"-"self-start management" to add your program</p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);">How to tell the user to set up, simple to play a toast is the simplest way, but it is better to automatically jump to that setting interface</p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);">After research</p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);">This self-initiated management is not a standalone apk, it is an activity in the system setup</p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);">Open the method as Follows:</p></p><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal; background-color: rgb(255, 255, 255);"><br></p></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">Intent i =</span> <span style="margin: 0px; padding: 0px; border: none; color: rgb(0, 102, 153); font-weight: bold; background-color: inherit;">New</span>  <span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">Intent (); </span></span></p></p><p><p> <span style="margin:0px; padding:0px; border:none; color:black; background-color:inherit;">                 ComponentName  Comp = <span style="margin:0px; padding:0px; border:none; Color:rgb (0, 102, 153); font-weight:bold; background-color:inherit; ">new </span> <span style="margin:0px; padding:0px; border:none; background-color:inherit;">  ComponentName (</span> <span style="margin:0px; padding:0px; border:none; color:blue; background-color:inherit;" "com.android.settings" < span> <span style="margin:0px; padding:0px; border:none; background-color:inherit;" ,    < span> </span> </span></span></p></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; color: blue; background-color: inherit;">"com.android.settings.BackgroundApplicationsManager"</span>  <span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">); </span></span></p></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">I.setcomponent (comp);</span></p></p><p><p><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">StartActivity (i);</span></p></p><p><p><br></p></p><p><p><br></p></p><p><p> Solve the problem of the Xiaomi phone not receiving the start-up broadcast </p> </p></span>

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.