I want to create a little widget which displays a green bulb if there
is network connectivity and a red bulb if there is none.

Design:

a) register a BroadcastReceiver to listen for network connectivity
events
b) If the receiver receives a network down/up event, it will notify
the NetworkUptimeWidget to update itself.

Questions:

1) It looks like I will have to duplicate the code in every activity
to listen for updates (I am already using the include element to share
the XML declarations for NetworkUptimeWidget ). Is there any way to
avoid this ?
2) I am currently using the ContentObserver to notify the widget about
changes. Obviously that was meant for database providers. Is it wrong
to use it like a publish/subscribe method in the general sense ?

Thanks

Gavin

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to