Beginning with Android 8.0 (API level 26), the system imposes additional restrictions on manifest-declared receivers. If your app targets API level 26 or higher, you cannot use the manifest to declare a receiver for most implicit broadcasts (broadcasts that do not target your app specifically).

意思静态注册的广播在8.0以上是不能用,推荐用代码注册广播。
解决方案可以这么做:

配置:

<receiver android:name="MyStart">

    </intent-filter>
</receiver>
代码:
Intent intent = new Intent();
                intent.setComponent(new ComponentName("com.example.y.myapplication","com.example.y.myapplication.MyStart"));
                getApplicationContext().sendBroadcast(intent);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2021-08-30
  • 2021-08-17
  • 2021-07-20
  • 2021-10-29
  • 2021-06-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-12-17
  • 2021-09-16
  • 2022-12-23
  • 2021-12-08
相关资源
相似解决方案