Josh wrote:
> Thanks for the reply.  I have one more somewhat similar question.  Is
> it possible to create an app that spawns a background / worker thread
> that listens for incoming text messages / emails / and then shows some
> alert?  I'm understanding how to create a worker thread called from a
> service with a handler for communication, but I don't understand (know
> if it is possible) to set up a broadcastreceiver or listener
> (broadcast receiver is what I'm really after) in that thread.

First, BroadcastReceivers are not "set up" in a thread. They are tied to
the main application thread. If your BroadcastReceiver is registered via
registerReceiver() in Java code, it can use AsyncTask, a
LinkedBlockingQueue, or some other background thread mechanism. If your
BroadcastReceiver is registered via the manifest, you will need to have
it pass control to an IntentService, since manifest-registered
BroadcastReceivers should not be starting threads.

Second, there is no broadcast Intent for emails.

Third, there is no documented broadcast Intent for SMS messages.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

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

Reply via email to