obtainSession

open fun obtainSession(@NonNull activity: Activity, @NonNull observerBehavior: ManagedGroundSdk.ObserverBehavior): ManagedGroundSdk

Obtains a GroundSdk session automatically managed according to the provided activity's lifecycle.

All observers registered through this session are resumed according to the provided observer behaviour.

Return

a GroundSdk session, automatically managed according to the given activity's lifecycle

Parameters

activity

the activity whose lifecycle will control the session's own lifecycle

observerBehavior

observer behaviour this session must comply to

open fun obtainSession(@NonNull activity: Activity): ManagedGroundSdk

Obtains a GroundSdk session automatically managed according to the provided activity's lifecycle.

All observers registered through this session are resumed in onStart and suspended in onStop. Use obtainSession to customize this behavior if unsuitable to the application needs.

Return

a GroundSdk session, automatically managed according to the given activity's lifecycle

See also

#obtainSession(Activity, ObserverBehavior)

#obtainSession(Activity, ObserverBehavior)

Parameters

activity

the activity whose lifecycle will control the session's own lifecycle