tags:

views:

266

answers:

1

Say if I have a locationManager(LM) object in activity A, which is my main menu. All the sub-activities need to use LM. In a good design, should I pass LM object to sub-activities? How? Please suggest some good coding pattern. Thanks.

+3  A: 

You could use an Application object, that is what API proposes for those cases, when you have multiple Activities with common state.

Fernando Miguélez
Foursquare is a good example of using the Application object: http://code.google.com/p/foursquared/
janfsd