Register your EntityBasedSearchable object with the Unified Search
Service
After you have
defined your
SearchableEntity class, and created an
EntityBasedSearchable class to represent your searchable
entities to the Unified Search Service, use the
SearchRegistry to register them with the Unified Search
Service.
-
Import the required classes and interfaces.
import net.rim.device.api.unifiedsearch.registry.RegistrationToken;
import net.rim.device.api.unifiedsearch.registry.SearchRegistry;
-
Create your
EntityBasedSearchable.
public class MyClass {
private MySearchable _searchable;
private RegistryToken _regToken;
public MyClass() {
_searchable = new MySearchable()
-
Register your
EntityBasedSearchable with the Unified Search
Service.
_regToken = SearchRegistry.getInstance().register(_searchable);
-
It is a good practice to test whether the registration was
successful.
if (! _regToken.isValid()) {
// Action to take if the registration is not valid.
}
}
}
Note: The registration token is unique to your
EntityBasedSearchable until the
BlackBerry® device
restarts. You should store your registration token and reuse it when you update
content using the
AppContentManager class.
Was this information helpful? Send us your comments.