Streets Of Boston wrote: > If you still need static access to these variable from other classes, > you can have just one static variable: The currently active instance > of your activity/service. Be sure to set this one to null when > onDestroy is called.
I agree with Mr. Boston (pssst...can I call you Streets? ;-) I have a slight preference for keeping a static reference to the service, rather than the activity. Services are naturally singletons: you'll either have zero or one of them. You *could* have more that one instance of your activity going, which might complicate a single static reference. Hence, if it's six of one/half dozen of the other, I'd lean towards putting the static reference on the service. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

