Broadcast receiver is not working in oreo and pie android

前端 未结 1 1633
终归单人心
终归单人心 2021-01-21 16:29

Boot broadcast receiver is not working and there is nothing in onReceive()

public class BootReceived extends BroadcastReceiver {
@Override
public void onReceive(         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 16:57

    1. Make sure that you have registered your receiver in Manifest .
    2. Implicit Broadcast Exceptions refer to this link to check if your implicit receiver is in exception list or not.
    3. if not in exception the you can make job scheduler or register your receiver in your code itself .Here is a nice snippet you could refer on It’s time to kiss goodbye to your implicit BroadcastReceivers

    0 讨论(0)
提交回复
热议问题