Android Guides | Samples

Android.OS.HandlerThread Class

Handy class for starting a new thread that has a looper.

See Also: HandlerThread

Syntax

[Android.Runtime.Register("android/os/HandlerThread", DoNotGenerateAcw=true)]
public class HandlerThread : Thread

Remarks

Handy class for starting a new thread that has a looper. The looper can then be used to create handler classes. Note that start() must still be called.

[Android Documentation]

Requirements

Namespace: Android.OS
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.OS.HandlerThread are listed below.

See Also: Thread

Public Constructors

Constructs a HandlerThread.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
LooperLooper. This method returns the Looper associated with this thread.
[read-only]
ThreadIdInt32. Returns the identifier of this thread.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Quit() : Boolean
Quits the handler thread's looper.
QuitSafely() : Boolean
Quits the handler thread's looper safely.

Protected Methods

OnLooperPrepared()
Call back method that can be explicitly overridden if needed to execute some setup before Looper loops.