Table of Contents

Class AndroidThreadScope

Namespace
Homa.Sdk.Foundation
Assembly
Homa.Sdk.Foundation.dll

Use this in an using block to automatically define a scope for attaching a managed thread to the Java VM.

public class AndroidThreadScope : IDisposable
Inheritance
AndroidThreadScope
Implements
Inherited Members

Constructors

AndroidThreadScope()

Initialize a new instance of AndroidThreadScope and attach the current thread to the Java VM. Has no effect on other platforms.

public AndroidThreadScope()

Fields

IsAttached

Is the current thread attached to work with JNI calls. This is always true when the scope is created on the main thread, for other threads it is true if UnityEngine.AndroidJNI.AttachCurrentThread() returns a successful status code.

public readonly bool IsAttached

Field Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

ThrowIfNotAttached()

Throws an exception if the current thread is not attached to the JVM. See IsAttached for more details.

public void ThrowIfNotAttached()

Exceptions

InvalidOperationException

Current thread is not attached to the JVM.