简体   繁体   English

屏幕关闭时前台应用程序被杀死

[英]Foreground app being killed when screen is off

I have a problem on my android phone where the app that I'm running in the foreground is getting killed if the screen is off.我的 Android 手机出现问题,如果屏幕关闭,我在前台运行的应用程序就会被杀死。 Examples include: listning to a podcast with stitcher, using voice mavigation with google maps, having an ongoing call using a voip app, listning to an audio book with audible.示例包括:使用拼接器收听播客、使用谷歌地图进行语音导航、使用 voip 应用程序进行持续通话、收听有声读物。

Apps get killed off at some random point when the screen is off.当屏幕关闭时,应用程序会在某个随机点被杀死。 eg sometimes it'll happen after a minute, sometimes i'll be 30 mins in a drive and a podcast will just cut out.例如,有时它会在一分钟后发生,有时我会开车 30 分钟,播客就会中断。 After this happens, if I unlock my phone, I'm back on my home screen.发生这种情况后,如果我解锁手机,我就会回到主屏幕。

Things I have tried:我尝试过的事情:

  • restarting my phone more regularly, no benefit更频繁地重启我的手机,没有任何好处
  • pin the foreground app before turning off the screen.在关闭屏幕之前固定前台应用程序。 no benefit.没有好处。
  • Uninstalling apps / stopping background services to reduce RAM usage.卸载应用程序/停止后台服务以减少 RAM 使用量。 I initially blamed RAM, but I've uninstalled a bunch of things and it's been no help.我最初责怪 RAM,但我已经卸载了很多东西,但没有任何帮助。

Other information about my phone:我的手机的其他信息:

  • LG G7 (LM-G710EMW), Android version 9, kernel version 4.9.112 LG G7 (LM-G710EMW),安卓版本9,内核版本4.9.112
  • Developer options -> running services: usually shows plenty of free RAM (eg right now, 1.2GB free).开发者选项 -> 正在运行的服务:通常会显示大量可用 RAM(例如,现在有 1.2GB 可用)。 When stitcher appears on this list, it uses about 250mb.当拼接器出现在这个列表中时,它使用大约 250mb。
  • Using nova launcher使用 nova 启动器
  • Not using any third party battery saving / optimization apps.不使用任何第三方省电/优化应用程序。 All apps mentioned have been selected in Settings -> Battery -> 'Power saving exclusions' for android's built in battery.提到的所有应用程序都已在“设置”->“电池”->“省电排除”中为 android 的内置电池选择。 Android's built in battery saver is turned off. Android 的内置电池保护程序已关闭。
  • Not using any third party apps that kill other apps, claim to free up RAM, etc. The only thing I have that could be killing other apps is tasker.不使用任何会杀死其他应用程序、声称释放 RAM 等的第三方应用程序。我唯一可以杀死其他应用程序的是 tasker。

So this is super annoying because it basically prevents me from using the phone for anything useful unless I keep the screen on.所以这非常烦人,因为它基本上阻止我使用手机做任何有用的事情,除非我保持屏幕打开。 I know I can darken the screen as much as possible, so keeping the screen on reduces battery drain, this is ok for navigation but not good enough for when you want to keep your phone in your pocket.我知道我可以尽可能地使屏幕变暗,所以保持屏幕开启可以减少电池消耗,这对于导航来说是可以的,但当你想把手机放在口袋里时还不够好。

I was blaming RAM - ie somehow I'm running out of RAM and android is killing the app that's using the most.我在责怪 RAM - 即不知何故,我的 RAM 用完了,而 android 正在杀死使用最多的应用程序。 But it makes no sense to kill the foreground app.但是杀死前台应用程序是没有意义的。

Open to any and all suggestions, even if it's a long shot.对任何和所有建议持开放态度,即使这是一个远景。

I'm not concerned about battery life at all.我根本不关心电池寿命。 If there's any other battery saving / optimization features I can turn off, I'm all for it.如果我可以关闭任何其他省电/优化功能,我完全赞成。

由于后台执行限制。为了保持您的应用程序不被杀死,您必须创建一个前台服务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android 6.0:正在删除应用程序时删除前台服务 - Android 6.0 : Foreground service is being removed when app is being killed 当应用程序被刷掉时前台服务被杀死 - foreground service getting killed when app is swiped off 屏幕关闭时服务被杀死 - service getting killed when screen turns off 前台服务被 Android 杀死 - Foreground service being killed by Android 当应用程序从前台被杀死时在 Ionic 应用程序中显示通知 - Showing Notifications in Ionic App when the app is killed from foreground 应用程序终止时警报不会响起 - Alarm not going off when app killed 当应用程序被杀死时,AlarmManager 在前台服务中不起作用 - AlarmManager does not work in foreground service, when app was killed 当我的应用程序前台服务被终止时,未收到 FCM 通知 - FCM Notification is not received when my app foreground service is killed 从最近的应用程序中删除应用程序时,“前台”服务将被终止 - “foreground” service is killed when App is removed from recent apps 当应用不在前台或被杀死时,如何使地理围栏工作? - how to make geofence work when app is not in foreground or it is killed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM