开发者

Playing ringtons in a broadcast receiver

开发者 https://www.devze.com 2023-01-23 11:05 出处:网络
I use pending_intents and a broadcast_receiver for pending events processing. When the broadcast_receiver receives an intent it creates an instance of a ringtone with STREAM_NOTIFICATION and `play()\'

I use pending_intents and a broadcast_receiver for pending events processing. When the broadcast_receiver receives an intent it creates an instance of a ringtone with STREAM_NOTIFICATION and `play()' it. But sounds is late for a few dozen minutes!

I have checked that the pending_intens are come in proper time and the broadcast_receiver proce开发者_开发百科sses them properly.

It seems there is a problem with playing notifications while a phone stay in sleep mode (screen is off).

Somebody know how to bypass the problem?


It seems that the PowerManager and WakeLock classes should be used to enable processor unit.

0

精彩评论

暂无评论...
验证码 换一张
取 消