Hello, I was wondering how to get a toast to pop up (or broadcast an intent) when receiving an incoming/outgoing call. Currently, I have 2 solutions, but I don't know if they're "good" - albeit one of them sort of works.
Solution 1: --------------- Define a class that extends PhoneStateListener, and also has a Context member variable. So when I create my CustomPhoneStateListener class, I can just pass in the current context (e.g. myActivity.this) and then do the TelephonyManager.listen() thing. This solution works (it allows me to create Toast messages and to broadcast intents), but I don't know if passing myActivity.this context into my CustomPhoneStateListener class is a good idea. Solution 2: --------------- In this article: http://groups.google.com/group/android-developers/browse_thread/thread/faec71c4ae854271/863b4933b64288af?lnk=gst&q=PhoneStateListener+context&utoken=NVF2MTUAAACwwFf96muIoaCUrXmA7_-MWVL371GGq1XIhUq6Q2-xET611MdJTlwC385T8DmntyzHKTO24aHzKC44Y5MO9bT5 it mentions something about a PHONE_STATE_CHANGED intent, but I can't seem to find any documentation about it anywhere. If this exists, would this be a better solution? Also, could someone point me to a website, or in a general direction? Thanks and regards. --Mark --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---