Språk

Instrumentation.RunOnMainSync Method

Definition

Overloads

Name Description
RunOnMainSync(IRunnable)

Execute a call on the application's main thread, blocking until it is complete.

RunOnMainSync(Action)

Posts the action to the application's main thread and waits for it to finish.

RunOnMainSync(IRunnable)

Execute a call on the application's main thread, blocking until it is complete.

[Android.Runtime.Register("runOnMainSync", "(Ljava/lang/Runnable;)V", "GetRunOnMainSync_Ljava_lang_Runnable_Handler")]
public virtual void RunOnMainSync(Java.Lang.IRunnable? runner);
[<Android.Runtime.Register("runOnMainSync", "(Ljava/lang/Runnable;)V", "GetRunOnMainSync_Ljava_lang_Runnable_Handler")>]
abstract member RunOnMainSync : Java.Lang.IRunnable -> unit
override this.RunOnMainSync : Java.Lang.IRunnable -> unit

Parameters

runner
IRunnable

The code to run on the main thread.

Attributes

Remarks

Execute a call on the application's main thread, blocking until it is complete. Useful for doing things that are not thread-safe, such as looking at or modifying the view hierarchy.

Android reference for android.app.Instrumentation.runOnMainSync.

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

RunOnMainSync(Action)

Posts the action to the application's main thread and waits for it to finish.

public void RunOnMainSync(Action runner);
member this.RunOnMainSync : Action -> unit

Parameters

runner
Action

The action to invoke on the application's main thread.

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