OfflineSearchIndexListener (API Reference)
Interface OfflineSearchIndexListener
Interface to get updates about progress of creating persistent map index.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after index creation or deletion has been completed.voidonProgress(int percentage) Called multiple times to indicate the progress of index creation or deletion.voidonStarted(OfflineSearchIndex.Operation operation) Called each time that the indexing has started.
-
Method Details
-
onStarted
Called each time that the indexing has started. It is triggered by changes to persistent map or by calling
OfflineSearchEngine.setIndexOptions. If a valid index was previously created for the installed regions, no additional indexing is performed, so no notifications are sent. In this context, a valid index is the one that contains data for the exact versions of the installed map regions. When any of them is updated or new regions are downloaded or deleted, the index becomes invalid and is automatically rebuilt, as long as indexing has been enabled previously. Invoked on the main thread.- Parameters:
operation-Shows whether the index is being created or removed.
-
onProgress
void onProgress(int percentage) Called multiple times to indicate the progress of index creation or deletion. Invoked on the main thread.
- Parameters:
percentage-Represents a percentage of work done.
-
onComplete
Called after index creation or deletion has been completed. Invoked on the main thread.
- Parameters:
error-Represents an error in case of a failure. It is
nullfor an operation that succeeds.
-