Oh ok. So I guess I should stick with the service because I want it to
run in the background, and yea I have unregistered it.

On May 25, 12:16 pm, Mark Murphy <[email protected]> wrote:
> GT wrote:
> > Oh, ok thank you. I will rephrase, when you run an app it goes through
> > the the android app life cycle. Lets say my activity that contains the
> > listener is terminated, will it start running and do what it needs to
> > if the phone rings? That is if its not a service...
>
> If you do the following:
>
> -- in an activity's onCreate(), register the PhoneStateListener
> -- never unregister the PhoneStateListener
> -- the activity is closed up on onDestroy()
>
> Then that is very very bad.
>
> Your listener will continue to receive notification of call events.
> However, its activity will not be on screen, nor ever will it be again
> on the screen, so the listener cannot do much of value.
>
> The same holds true if this is a service's onCreate() and onDestroy().
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books.html
--~--~---------~--~----~------------~-------~--~----~
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