Let me put it in C terms:
    When you pass in the LocationListener object to
requestLocationUpdates() method, you are passing a value of the
reference to LocationListener, not a reference to the field/variable
mListener.

Some help on Java in this area:
http://stackoverflow.com/questions/40480/is-java-pass-by-reference
http://www.yoda.arachsys.com/java/passing.html

On 7 янв, 09:16, "fourhend...@gmail.com" <fourhend...@gmail.com>
wrote:
> Even if its the same object/  same listener?
> On Jan 6, 2011 8:53 PM, "John Lussmyer" <johnlussm...@gmail.com> wrote:> The 
> old one will stay around, and continue being called. You should remove
> > the old listener.
>
> > On Thu, Jan 6, 2011 at 6:13 PM, fourhend...@gmail.com <
>
> fourhend...@gmail.com
>
> >> wrote:
>
> >> Quick question, kind of java related I think, too. If you have a
> >> locationlistener mListener, and install it with "*
> >> requestLocationUpdates". *Lets say you assign a new LocationListener to
> >> mListener and install it again, is the previous one going to go away
> >> (garbage collected)? In C I would just delete one and allocate a new one.
> >> What's the best way in java+android?
>
> > --
> > 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<android-developers%2bunsubscr...@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 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

Reply via email to