开发者

Android: How does Application class work with remote processes?

Say that my app implements a subclass of Application has 2 different ser开发者_Python百科vices running different processes.

What happens if I call getApplication() in each Service? Will I get back 2 completely independent instances, 1 for each process?

If so, then will the 2 instances be somehow linked? In other words, would modifications made to the instance in one process show up in the instance made in the other?


Say that my app implements a subclass of Application has 2 different services running different processes.

99.9999% of Android applications do not need this, and it wastes RAM, CPU, and battery.

Will I get back 2 completely independent instances, 1 for each process?

Of course. They are different processes.

If so, then will the 2 instances be somehow linked?

No.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜