문제

I have a service A, which is started by WakefulBroadcastReciever from AlarmManager. Service A follows a standard pattern - performs a computation, then sends local broadcast to inform the system about the results, then calls WakefulBroadcastReceiver.completeWakefulIntent().

Depending of the results of the computation,i.e. content of the local broadcast, other local services may need to perform some computation immediately. However, am I guaranteed that the other services will receive the local broadcast at all before the device goes back to sleep?

If not, I guess another solution would be to use explicit callbacks. Is there a standard pattern for this?

Thanks!

도움이 되었습니까?

해결책

Local Broadcast manager has a sync mode. Beware ! The onReceive runs in the thread it is called from - not the main (UI) thread.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top