SearchCallback

SearchCallbacks are notified when the AddonRepository search completes. If the search succeeded, then searchSucceeded() is called and is passed an array of Addon objects that matched the search. Since these Addons are not actually installed, the AddonManager does not know about them. However, for each returned add-on, an AddonInstall object is created, which the AddonManager does know about. Each AddonInstall can be accessed through the Addon install attribute, and is initially in the STATE_AVAILABLE state. The array of Addons passed to  searchSucceeded() only includes add-ons that are compatible with the current application and are not already installed or being installed. The AddonRepository is available for another search once one of the callback functions is called.

Method Overview

void searchSucceeded(in Addon addons[], in integer addonCount, in integer totalResults)
void searchFailed()

Methods

searchSucceeded()

Called when a successful search completes.

void searchAddons(
  in Addon addons[],
  in integer addonCount,
  in integer totalResults
);
Parameters
addons
Array of Addon objects representing the add-ons found by the search. The array represents a subset of the total add-ons available in the repository that match the search.
addonCount
The number of add-ons returned. Note, addons.length == addonCount.
totalResults
The total number of results available in the repository.

searchFailed()

Called when a search results in failure. A new search will immediately fail if AddonRepository is completing another search request.

void searchFailed();
Parameters

None.

See also

Document Tags and Contributors

Contributors to this page: bparr, Sheppy
Last updated by: Sheppy,