I have a service S and a bunch of activities A,B,C,D etc.  The service S is 
sending broadcasts. Activity A is currently manually registering a 
broadcastreceiver on onResume and unregistering the receiver on onPause.  
But I was thinking if it is possible to do all this "automagically" through 
the manifest, and to do away with the register/unregister calls.

Like, list the broadcast as an action filter for activity A, and then 
somehow explain to the constructor of activity A that it should also behave 
like a broadcastreceiver (and serve the onReceive function).  

I tried to use "public class MainScreen extends Activity implements 
BroadcastReceiver" but that is not liked by Eclipse ("The type 
BroadcastReceiver cannot be a superinterface of MainScreen; a 
superinterface must be an interface")

So how do I tell the activity to listen for the broadcasts?

-- 
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