Sunday, July 28, 2013

[android-developers] send message from class to activity

I have a class named SMSReceiver that extends BroadcastReceiver.  I instantiate an object of this class from the onCreate event in mainActivity.  SMSReceiver listens for stuff and when it finds what it wants it needs to send a data message back to the Activity and trigger some event in the activity that will handle it.  SMSReceiver has to stay instantiated as long as the app is running.

I've googled around all over but can't seem to find anything that works.  I have done a lot of messaging between services and activities but never from a class back to the activity that instantiated it.  I see a lot of info on using intents to do this but nothing that would accomplish what I need to do.

What is the best way to accomplish this?
Thanks,
Gary

--
--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate