-->

Vibration even when the screen has timed out

2019-08-27 04:04发布

问题:

I'm using the examples from this site: http://android.konreu.com/developer-how-to/vibration-examples-for-android-phone-development/

So, as you see, I'm using the Vibrator Service. The problem, which also is written on the site, is that the vibration don't work if the screen has timed out.

Anyone has any ideas to fix this? It surely should work as the vibration works on phone calls, alarm etc. even though the screen is black. But maybe I have to wake up the phone before the vibration is called?

回答1:

See this page about acquiring a wake lock. Hopefully it will do what you want.