Well, I need to disable the listeners when the app goes into the
background, not only when it terminates.

I also tested this use of WeakReference, simply to see how it behaves,
and it didn't work for me at all. Regardless of whether the app was
paused to display another application or to display another activity
of the same app, the identity test for 'this' always succeeded.

Frankly, I do not understand how this would work at all. In onCreate
(), the reference is set to 'this' (the current activity), otherwise
it is set to null. So the test for 'this' in onPause is only true, if
onPause() is called on the same activity instance that created the
weak reference in onCreate. But how could those ever be two distinct
objects? Is it possible that resuming an activity will not resurrect
the old one, but create a new activity object? But wouldn't that be
the same as simply doing an onCreate? I'm confused.
--~--~---------~--~----~------------~-------~--~----~
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