NavigationApi.NavigatorListener

  • NavigationApi.NavigatorListener provides status updates on the Navigator object.

  • It offers two callbacks: onError for initialization failures and onNavigatorReady for successful creation.

  • Callbacks are executed on the UI thread, potentially even after the Activity has finished, requiring checks for Activity status.

  • onError provides an error code from NavigationApi.ErrorCode for diagnosing initialization issues.

  • onNavigatorReady delivers the ready-to-use Navigator instance.

public static interface NavigationApi.NavigatorListener

Register a NavigatorListener with NavigationApi.getNavigator(Activity, NavigatorListener) to be notified about the status of said Navigator. Note that only one of NavigatorListener's methods will be called, and that all calls occur on the UI thread.

Note: That method may be called after Activity.finish(), and a check against Activity.isFinishing() or Activity.isDestroyed() may be necessary before some operations. For example, during a rapid succession of context changes.

Public Method Summary

abstract void
onError(int errorCode)
Indicates that an error occurred while initializing the Navigator.
abstract void
onNavigatorReady(Navigator navigator)
Indicates that a Navigator was created successfully, and returns it to the caller.

Public Methods

public abstract void onError (int errorCode)

Indicates that an error occurred while initializing the Navigator.

Parameters
errorCode one of the NavigationApi.ErrorCode constants

public abstract void onNavigatorReady (Navigator navigator)

Indicates that a Navigator was created successfully, and returns it to the caller.

Parameters
navigator the created Navigator object