Partager via


HandlerThread.Quit Method

Definition

Quits the handler thread's looper.

[Android.Runtime.Register("quit", "()Z", "GetQuitHandler")]
public virtual bool Quit ();
[<Android.Runtime.Register("quit", "()Z", "GetQuitHandler")>]
abstract member Quit : unit -> bool
override this.Quit : unit -> bool

Returns

True if the looper looper has been asked to quit or false if the thread had not yet started running.

Attributes

Remarks

Quits the handler thread's looper.

Causes the handler thread's looper to terminate without processing any more messages in the message queue.

Any attempt to post messages to the queue after the looper is asked to quit will fail. For example, the Handler#sendMessage(Message) method will return false.

<p class="note"> Using this method may be unsafe because some messages may not be delivered before the looper terminates. Consider using #quitSafely instead to ensure that all pending work is completed in an orderly manner. </p>

Java documentation for android.os.HandlerThread.quit().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also