API reference
API reference
Select your platform
No SDKs available
No versions available

SpatialActivityManager Object

This object is used to manage the current activity. It is used to get a weak reference to the current activity and execute code on the current activity.
Example of getting a reference to the SystemManager or SpatialContext via the activity:
SpatialActivityManager.getAppSystemActivity().getSystemManager().findSystem<MySystem>() // Grabs the system manager which provides access to all registered systems.
SpatialActivityManager.getAppSystemActivity().getSceneObject() // Grabs the scene

Signature

object SpatialActivityManager

Properties

currentActivity : WeakReference?
[Get][Set]
The current Spatial activity.
Signature
var currentActivity: WeakReference<AppSystemActivity>?

Functions

executeOnAppSystemActivity ( runnable )
This function is used to execute a block of code on the current AppSystemActivity's main thread. If the current activity has not been set or has been garbage collected, it will throw an exception.
Signature
fun executeOnAppSystemActivity(runnable: (activity: AppSystemActivity) -> Unit)
Parameters
runnable: Function1
  The block of code to be executed on the current AppSystemActivity.
executeOnVrActivity ( runnable )
This generic function is used to execute a block of code on the current activity's main thread. If the current activity has not been set or has been garbage collected, it will do nothing.
Signature
inline fun <T : AppSystemActivity> executeOnVrActivity(crossinline runnable: (activity: T) -> Unit)
Parameters
runnable: Function1
  The block of code to be executed on the current activity.
getAppSystemActivity ()
This function is used to get the current activity. This allows you to specify your activity so that you can access data on it. If the current activity has not been set or has been garbage collected, it will return null. Otherwise, it will return the current activity and cast it to type AppSystemActivity.
Signature
fun getAppSystemActivity(): AppSystemActivity
getVrActivity ()
This generic function is used to get the current activity. This allows you to specify your activity so that you can access data on it. If the current activity has not been set or has been garbage collected, it will return null.
Signature
inline fun <T : AppSystemActivity> getVrActivity(): T
Returns
  The current activity.
Did you find this page helpful?