简体   繁体   English

在应用程序处于后台或应用程序未运行时来电时,Lenovo L18021(A5) 中未调用广播接收器

[英]On Incoming Call when app is in background or app is not running the broadcast receiver is not called in Lenovo L18021(A5)

I am developing a custom dailer App incoming call screen but my problem is that when the app is in foreground, on incoming call the broadcast receiver is called and displays the custom screen but when the app is in the background or not in running state then the broadcast receiver is not called.我正在开发一个自定义 dailer App 来电屏幕,但我的问题是,当应用程序处于前台时,在来电时,广播接收器被调用并显示自定义屏幕,但是当应用程序处于后台或不在运行 state 时不调用广播接收器。 How to resolve this?如何解决这个问题?

And Also Getting this Log并且还获取此日志

ConnectionTracker: Exception thrown while unbinding java.lang.IllegalArgumentException: Service not registered: lt@3e5af9d ConnectionTracker:解除绑定 java.lang.IllegalArgumentException 时抛出异常:服务未注册:lt@3e5af9d

On some devices (notably low-end and Chinese manufacture) apps are not permitted to perform background activities if they are not in a list of "protected apps".在某些设备(尤其是低端设备和中国制造商)上,如果不在“受保护应用程序”列表中,则不允许应用程序执行后台活动。 This is done to save battery life.这样做是为了节省电池寿命。 If your device does this, it will not launch a BroadcastReceiver if the app is not already running.如果您的设备执行此操作,如果应用程序尚未运行,它将不会启动BroadcastReceiver To fix this you will need to manually add your app to the list of "protected apps" or "apps allowed to perform background activities".要解决此问题,您需要手动将您的应用添加到“受保护的应用”或“允许执行后台活动的应用”列表中。 There is a setting in the Android settings for the user to maintain this list of apps. Android 设置中有一个设置供用户维护此应用程序列表。 It is usually in the "Security" or "Power management" settings somewhere.它通常在某处的“安全”或“电源管理”设置中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM