Share via


Instrumentation.RunOnMainSync Method

Definition

Overloads

RunOnMainSync(IRunnable)

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

RunOnMainSync(Action)

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.

Java documentation for android.app.Instrumentation.runOnMainSync(java.lang.Runnable).

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)

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

Parameters

runner
Action

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