Udostępnij za pośrednictwem


Handler.PostDelayed Method

Definition

Overloads

PostDelayed(IRunnable, Int64)

Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses.

PostDelayed(Action, Int64)
PostDelayed(IRunnable, Object, Int64)

Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses.

PostDelayed(IRunnable, Int64)

Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses.

[Android.Runtime.Register("postDelayed", "(Ljava/lang/Runnable;J)Z", "")]
public bool PostDelayed (Java.Lang.IRunnable r, long delayMillis);
[<Android.Runtime.Register("postDelayed", "(Ljava/lang/Runnable;J)Z", "")>]
member this.PostDelayed : Java.Lang.IRunnable * int64 -> bool

Parameters

r
IRunnable

The Runnable that will be executed.

delayMillis
Int64

The delay (in milliseconds) until the Runnable will be executed.

Returns

Returns true if the Runnable was successfully placed in to the message queue. Returns false on failure, usually because the looper processing the message queue is exiting. Note that a result of true does not mean the Runnable will be processed -- if the looper is quit before the delivery time of the message occurs then the message will be dropped.

Attributes

Remarks

Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses. The runnable will be run on the thread to which this handler is attached. <b>The time-base is android.os.SystemClock#uptimeMillis.</b> Time spent in deep sleep will add an additional delay to execution.

Java documentation for android.os.Handler.postDelayed(java.lang.Runnable, long).

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

PostDelayed(Action, Int64)

public bool PostDelayed (Action action, long delayMillis);
member this.PostDelayed : Action * int64 -> bool

Parameters

action
Action
delayMillis
Int64

Returns

Remarks

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

PostDelayed(IRunnable, Object, Int64)

Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses.

[Android.Runtime.Register("postDelayed", "(Ljava/lang/Runnable;Ljava/lang/Object;J)Z", "", ApiSince=28)]
public bool PostDelayed (Java.Lang.IRunnable r, Java.Lang.Object? token, long delayMillis);
[<Android.Runtime.Register("postDelayed", "(Ljava/lang/Runnable;Ljava/lang/Object;J)Z", "", ApiSince=28)>]
member this.PostDelayed : Java.Lang.IRunnable * Java.Lang.Object * int64 -> bool

Parameters

r
IRunnable

The Runnable that will be executed.

token
Object

An instance which can be used to cancel r via #removeCallbacksAndMessages.

delayMillis
Int64

The delay (in milliseconds) until the Runnable will be executed.

Returns

Returns true if the Runnable was successfully placed in to the message queue. Returns false on failure, usually because the looper processing the message queue is exiting. Note that a result of true does not mean the Runnable will be processed -- if the looper is quit before the delivery time of the message occurs then the message will be dropped.

Attributes

Remarks

Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses. The runnable will be run on the thread to which this handler is attached. <b>The time-base is android.os.SystemClock#uptimeMillis.</b> Time spent in deep sleep will add an additional delay to execution.

Java documentation for android.os.Handler.postDelayed(java.lang.Runnable, java.lang.Object, long).

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