开发者

Broadcast Intents Android

开发者 https://www.devze.com 2022-12-09 07:22 出处:网络
How Good are broadcast intent` in terms of say I w开发者_开发问答anted to fire broadcast intents ten times a second for half an hour.

How Good are broadcast intent` in terms of say I w开发者_开发问答anted to fire broadcast intents ten times a second for half an hour.

Right now I have a service doing this, and it runs perfectly well until the user rotates the screen: then it gets all messed up and stupid and gives errors.

However, broadcast intents are short live objects, so how would these perform in my conditions?


Broadcast Intents involve cross-process IPC; firing those that quickly for that long will eat quite a bit of battery life. Intents are not designed to be broadcast quite that often.

If your service is getting "messed up" because of a screen rotation, your activity is at fault, perhaps by stopping the service when it shouldn't. Services are not directly affected by screen rotations.

0

精彩评论

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