I have an Widget Application that also has Activities, and a heavily used Service full of functions. I would like to keep a global status for the application. This is app/widget specific state like say STARTED, LEVEL1, LEVEL2 etc, so since the status is referenced in the widget, the service, and activities I thought a static variable in an Application Subclass might be good. So my question is twofold.
1) Where should I keep such a state/status variable as a syncronized static variable in an application subclass? And 2) Its first initial value depends on reading some values by calling registerReceiver(null, intent) passing null for the receiver in order to obtain some system values. Where should I do this initialization. The Application.onCreate() docs indicate that not much should happen in this method. I am thinking in the Widget.update method can call getApplication and perform the registerReceiver operation and then update the static variable in the Applicaiton subclass. Is this the right place to initialize the application state? Thanks -- 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

