Service? On 18 September 2012 18:37, Stephan Steiner <[email protected]>wrote:
> Hi My application needs to detect network state changes. I implemented > that using the IntentFilter tag on a class derived from BroadcastReceiver. > It all works well (android doc isn't great at explaining how to work all > the extras, but I managed to figure it out using the good old trial & error > approach). Now, if my application isn't running, my broadcast receivers > still are awoken if there's a network state change (as confirmed by simply > launching a toast). So I figure that adding the IntentFilter attribute on a > BroadcastReceiver performs a global registration that works from the point > where the system has booted until it shuts down. I found some examples > where people register for intents in code when needed (e.g. in OnResume of > an activity, then unregister again in OnPause) - and I'm left wondering if > there's some middle ground. Say I don't care which activity of my app is > running, whether or not my app is in the foreground - but just "is my app > running then I care about network state changes, if it isn't, don't wake up > my app". Is there a way of achieving this without having to register / > unregister from every single activity? Regards Stephan > ------------------------------ > View this message in context: Intentfilter & register for > intents<http://mono-for-android.1047100.n5.nabble.com/Intentfilter-register-for-intents-tp5711862.html> > Sent from the Mono for Android mailing list > archive<http://mono-for-android.1047100.n5.nabble.com/>at Nabble.com. > > _______________________________________________ > Monodroid mailing list > [email protected] > > UNSUBSCRIBE INFORMATION: > http://lists.ximian.com/mailman/listinfo/monodroid > > -- Gonçalo Oliveira
_______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
