在后台运行的应用越来越关闭,由于过度唤醒锁定错误 [英] Application running in background getting closed due to Excessive Wake lock error

查看:318
本文介绍了在后台运行的应用越来越关闭,由于过度唤醒锁定错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发出将具有活动和一个后台服务和所有活动必须与服务绑定时的任何请求必须被发送到服务器,并响应将被发送回寄存器一个应用activities.Now有一个要求在我的应用程序可以在前台后台也运行以及所以我重写设备的返回键,并呼吁moveTaskToBack()方法,并指出我的应用程序运行完美,当它被切换到后台,直到这点应用正按预期但是,当设备进入睡眠模式一段时间后,应用程序关闭掉,所以我们观察到,随着Wi-Fi已得到关闭,然后让应用程序的套接字连接也越来越封闭,我们获取的应用程序的部分唤醒锁和应用工作正常当它运行模式和设备进入锁定/睡眠模式,但是当应用程序被切换到后台后15至20分钟,这是越来越封闭,当我在DDMS看到它的显示,然后关闭所有窗口和杀害的应用过度唤醒锁申请程序。
我收购后台服务的onCreate()方法唤醒部分锁在的onDestroy()方法。松开

I have developed one application which will have activities and one background service and all activities will have to bind with service when any request has to be sent to the server and response will be sent back to the register activities.Now there is one requirement where my application can run in foreground as well as in background also so for that i overridden device's back key and called moveTaskToBack() method and observed that my application is running perfectly when it goes to background, till this point application is working as expected but when device goes to sleep mode after some time application get closed , so we observed that as Wi-Fi is getting turned off so application's socket connection is also getting closed then we have acquired the partial wake lock of the application and application is working fine when it is running mode and device goes to lock/sleep mode but when application goes to background after 15 to 20 mins it is getting closed and when i see in DDMS it's displaying "Excessive wake lock in the application" then closing all windows and killed the application process. I am acquiring partial wake lock in background service's onCreate() method and releasing it in onDestroy() method.

有没有人帮我,为什么它正在发生,以及如何解决它。

does anyone help me out why it is happening and how to resolve it.

问候,
皮克斯

Regards, Piks

推荐答案

好吧,显然操作系统是比你聪明。它只是试图压抑吸吮所有的电池果汁您的应用程序$ P $。要解决这个问题,你必须要有礼貌citzizen。
(相信我,你的申请将被甩出用户的手机上时,它的行为这样的地方。)

Well, apparently OS is smarter than you. It just tries to preent your application from sucking all the battery juice. To resolve this problem, you have to be polite citzizen. (and trust me, your application will be thrown off user phone on the spot when it behaves this way.)

为什么它在所有运行所有的时间?

Why it has to run all the time at all?

这篇关于在后台运行的应用越来越关闭,由于过度唤醒锁定错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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