通知显示在 android 模拟器中,但不在物理设备上 [英] Notification shows up in android emulator but not on physical device

查看:72
本文介绍了通知显示在 android 模拟器中,但不在物理设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 JobScheduler 设置了 30 分钟的及时通知,我的应用程序在 30 分钟后在 Android Emulator(Pixel 3 API 29 Q-10)中显示通知,但不在我的物理设备(Samsung S8 Android 9 Pie)上显示.奇怪的是,当我在 30 分钟后打开应用程序时,会显示相同的通知.android 有什么限制吗?

I have set a timely notification of 30 minutes using JobScheduler, my app shows the notification in Android Emulator(Pixel 3 API 29 Q-10) after 30 minutes but not on my physical device(Samsung S8 Android 9 Pie). The weird thing is the same notification shows up when I open the app after 30 minutes. Are there any restrictions in android?

到目前为止我已经尝试过:

I have tried so far:

  • 使用 USB 调试器模式在物理设备上运行应用,没有错误.
  • 单独构建 APK 并将其安装在设备中

推荐答案

我发现,如果手机处于省电模式或任何电池优化模式,通知将不会显示.关闭省电模式对我有用.

I found that, If the phone is in power saver mode or any battery optimized mode the notifications won't show up. Turning off power saver mode worked for me.

这篇关于通知显示在 android 模拟器中,但不在物理设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆