1

I'm writing an app, which listens to GSM signal strength. I've created a service, in which I put the PhoneStateListener. The problem is, that PhoneStateListener does not listen to any changes while phone is in sleep mode. I really need to solve that problem, could anyone help me with this? I tried to use that code in onCreate() method:

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "call_lock");
wakeLock.acquire();

but it doesn't solve my problem, listener is still not listening in sleep mode.

4

1 回答 1

1

您的解决方案没有解决方案。重新考虑您的代码。有关更多信息,请阅读本文更多信息

于 2012-09-16T14:52:43.047 回答