Titanium.App.removeEventListener

Function of Titanium.App. Inherited from Titanium.Proxy.
Platform Since
Android 0.1
iPhone 0.1
iPad 0.1
Mobile Web 1.8

Summary

Removes the specified callback as an event listener for the named event.

Description

Multiple listeners can be registered for the same event, so the callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called.); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);

Arguments

Name Type Summary
name String

Name of the event.

callback Callback<Object>

Callback function to remove. Must be the same function passed to addEventListener.

Return Type

void