Tuesday, September 14, 2010

[android-developers] Broadcasting and receiving

My IntentService is happily chugging away and sends a broadcast of
results when it's done:

intent.setAction("mySpecialName");
sendBroadcast(intent);

Meanwhile, my main thread has a receiver defined like this:

registerReceiver( myReceiver = new
BroadcastReceiver() {
@Override
public void onReceive(Context arg0, Intent theIntent ) {
// process the received data
} }
, new IntentFilter("mySpecialName") );

But the onReceive method is not getting the message. I'm guessing I
need to do something with "mySpecialName" in the manifest or some
such. Any pointers?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate