Samsung Glaxy S4 users report that the BOOT_COMPLETED receiver is not working?

In one of my applications in the playback store, there is a BOOT_COMPLETED receiver, and it never had problems before S4, I received several emails from S4 users, stating that the application was not working, and after some troubleshooting, the BOOT_COMPLETED receiver BOOT_COMPLETED not receive the call.

Does anyone know how to fix this for this particular device?

Here is the main code:

 public class BootCompletedIntentReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { ... ... //ALL MY CODE IS HERE ... ... } } } 

Manifesto:

  <receiver android:name=".BootCompletedIntentReceiver" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> 

Of course, I have the correct permission:

 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
+4
source share
1 answer

BOOT_COMPLETE is sent before installing external storage. if the application is installed on external storage, it will not receive a BOOT_COMPLETE broadcast message. To prevent this, you can install the application in the internal memory. you can do this by simply adding this line to menifest.xml.

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" ... > 

Some HTC devices may enable the โ€œquick bootโ€ feature, which is more like deep hibernation rather than a real reboot, and therefore should not give the intent of BOOT_COMPLETE. To restore this, your recipient will like the following:

  <receiver android:name="YOUR_FULL_PACKAGE_NAME.BootStartUpReciever" android:enabled="true" android:exported="true" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.QUICKBOOT_POWERON" /> </intent-filter> </receiver> 

This process works on my Samsung Galaxy SM-T235Y Tab4 , but does not work on the Samsung GT-S7852 . Related Topic here

0
source

Source: https://habr.com/ru/post/1487516/


All Articles