1. In the high version, users send custom broadcasts, but cannot receive information
Intent intent = new Intent();
intent.setAction("demo.destroy");
intent.setComponent( new ComponentName( "luoy.com.servicebackstage" ,
"luoy.com.servicebackstage.MyReceiver"));
sendBroadcast (intent);
Two parameters of setComponent, the first is the package name, the second is the path of Receive
2. The system broadcast cannot be received
Some special broadcasts must be registered dynamically, static registration has no effect
Similar, lock screen and open screen of the screen
IntentFilter recevierFilter=new IntentFilter();
recevierFilter.addAction(Intent.ACTION_SCREEN_ON);
recevierFilter.addAction(Intent.ACTION_SCREEN_OFF);
MyReceiver receiver=new MyReceiver();
registerReceiver(receiver, recevierFilter);https://blog.csdn.net/qq_30711091/article/details/86657268