8

Scope: Have to update activity UI in different ways. Update depends on broadcasts received from service. Problem: There are two common ways to find out which way UI should be updated:

  1. register only 1 broadcast receiver but put different extras in its intent and check for them in OnReceive() method in activity;
  2. register broadcasts for each update command.

The 2nd ways seems to be more elegant and more understandable. But I wonder if it will consume more memory. What would you recommend? Thanks!

2 Answers 2

4

It should not make a major difference either way.

3

I agree with CommonsWare. From a perfomance standpoing this isn't really something you need to worry about. That said, I'd probably go with 2nd way for the sole reason that it will make your code more modular thus improving maintainability.

1
  • Totally agree! Thanks, no more doubts about it. Oct 24, 2011 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.