重新启动后,广播接收器不工作 [英] Broadcast Receiver not working after reboot

查看:363
本文介绍了重新启动后,广播接收器不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在清单登记拦截呼叫的广播接收器,这样的:

I have an broadcast receiver registered in the manifest for intercepting calls, like this:

    <receiver android:name="CallTracker">
        <intent-filter>
            <action android:name="android.intent.action.PHONE_STATE" />
        </intent-filter>
    </receiver>

一切工作正常和接收器被调用。
但是,我重新启动设备或我的AVD之后,接收器不会被称为了

Everything works fine and the receiver gets called. But after I restart the device or my AVD, the receiver doesn't get called anymore.

我有什么才能让我的广播接收装置重启后的工作,也做什么?
我是否需要软件包管理系统是什么?
我喜欢在清单中注册,因为应用程序没有被激活,以便应用程序拦截呼叫。

What do I have to do in order to get my broadcast receiver to work after reboot, too? Do I need PackageManager for that? I like the registration in the manifest, since the application doesn't have to be active in order for the app to intercept the call.

推荐答案

您需要将此操作添加到你的意图过滤器。

You need to add this action to your intent-filter.

&lt;作用机器人:名字=android.intent.action.BOOT_COMPLETED/&GT;

这篇关于重新启动后,广播接收器不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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