1

设备/应用当前环境:

  • 设备设置为暗模式;
  • 该应用程序正在强制禁用暗模式 ( AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO))。

当我从设备主页启动应用程序时,一切正常。使用的颜色/图像资源都是正确的。

但是,当我从辅助进程从应用程序启动 Activity 时,使用 a PendingIntent,使用的颜色/图像资源并不全部正确。一些night-value资源被不受欢迎地使用。

Intent intent = new Intent(context, SomeActivity.class);

PendingIntent pendingIntent = PendingIntent.getActivity(
        context,
        0,
        intent,
        0
);

pendingIntent.send();

recreate()Obs.:在活动结束 5 秒后强制进行onCreate活动,将其修复。

做了一些研究,我发现那个androidx.appcompat:appcompat版本可能与它有关。在版本1.1.0上会出现错误,但1.2.0 (alpha 3)不会出现。


这是一个已知的 Android 错误吗?
是否有任何不使用 alpha 版本的解决方法androidx.appcompat:appcompat

4

0 回答 0