三星Glaxy S4用户报告说,BOOT_COMPLETED接收器将不能正常工作? [英] Samsung Glaxy S4 users report that BOOT_COMPLETED receiver won't work?

查看:469
本文介绍了三星Glaxy S4用户报告说,BOOT_COMPLETED接收器将不能正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么我的Play商店的应用程序之一,有一个 BOOT_COMPLETED 接收器,它从未有任何问题,直到S4,我说收到多封电子邮件从S4用户该应用程序无法正常工作经过一番排查 BOOT_COMPLETED 接收器是没有得到调用。

有谁知道这里如何解决这一问题的特定设备?

下面是它的主要code:

 公共类BootCompletedIntentReceiver扩展广播接收器{@覆盖
公共无效的onReceive(上下文的背景下,意图意图){
    如果(android.intent.action.BOOT_COMPLETED.equals(intent.getAction())){
        ...
        ...
        //我所有的code IS HERE
        ...
        ...
    }
}
}

清单:

 <接收机器人:名字=。BootCompletedIntentReceiver>
        &所述;意图滤光器>
            <作用机器人:名字=android.intent.action.BOOT_COMPLETED/>
        &所述; /意图滤光器>
    < /接收器>

当然,我有正确的权限:

 <使用许可权的android:NAME =android.permission.RECEIVE_BOOT_COMPLETED/>


外部存储安装前解决方案

BOOT_COMPLETE发送。如果应用程序安装到外部存储它不会收到BOOT_COMPLETE广播消息。以prevent这一点,你可以安装在内部存储应用程序。你可以这样做只是添加在menifest.xml此行。

 <清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
   安卓的installLocation =internalOnly
    ...>

一些HTC设备可以启用快速启动功能,更像是一个深深的冬眠,而不是一个真正的重新启动,因此不应给予BOOT_COMPLETE意图。要恢复该接收机将是这样的:

 <接收
            机器人:名字=YOUR_FULL_PACKAGE_NAME.BootStartU preciever
            机器人:启用=真
            机器人:出口=真正的>
            &所述;意图滤光器>
                <作用机器人:名字=android.intent.action.BOOT_COMPLETED/>
                <作用机器人:名字=android.intent.action.QUICKBOOT_POWERON/>
            &所述; /意图滤光器>
        < /接收器>

此过程工作在我的三星Galaxy SM-T235Y TAB4 但是不要在三星GT-S7852 手机工作。相关主题是这里

Well one of my apps on the play store have a BOOT_COMPLETED receiver and it have never got any issue until the S4, I have received multiple emails from S4 users saying that the app isn't working and after some troubleshooting the BOOT_COMPLETED receiver is not getting called.

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

Here's the main code of it:

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
        ...
        ...
    }
}
}

Manifest :

    <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" />

解决方案

BOOT_COMPLETE is sent before external storage is mounted. if app is installed to external storage it won't receive BOOT_COMPLETE broadcast message. To prevent this you can install your application in internal storage. you can do this just adding this line in menifest.xml.

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

Some HTC devices can enable a "fast boot" feature that is more like a deep hibernation and not a real reboot and therefore should not give the BOOT_COMPLETE intent. To recover this your receiver will like this:

        <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 is working on my Samsung Galaxy SM-T235Y Tab4 but don't worked on Samsung GT-S7852 phone. Related Thread is here

这篇关于三星Glaxy S4用户报告说,BOOT_COMPLETED接收器将不能正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆