Unsubscribe to a GlobalEventListener

Hi all -

Is it necessary to 'clean up' listeners, specifically a GlobalEventListener? If I have a screen that I sign up using addGlobalEventListener (this), I have to explicitly call removeGlobalEventListenerat some point (save or the close method?) or is it processed when the form is destroyed?

Thank you.

Dave

I believe if you have saved an object for listening to the GlobalEvents, this object will continue to exist (as there is a reference to it).  These objects will be get curly when the Application is closed (System.exit ()).  However, you must use the removeGlobalEventListener to remove all references to the objects that you no longer want to listen to world events, if you're not, at the same time, also to close the Application.

If you do not, there is an overhead could be significant (as well as create confusion) that listeners who are really no longer active, but who could still relate to the events...

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for