Android.OS.StrictMode.SetThreadPolicy Method
Sets the policy for what actions on the current thread should be detected, as well as the penalty if such actions occur.

Syntax

[Android.Runtime.Register("setThreadPolicy", "(Landroid/os/StrictMode$ThreadPolicy;)V", "")]
public static void SetThreadPolicy (StrictMode.ThreadPolicy policy)

Parameters

policy
the policy to put into place

Remarks

Sets the policy for what actions on the current thread should be detected, as well as the penalty if such actions occur.

Internally this sets a thread-local variable which is propagated across cross-process IPC calls, meaning you can catch violations when a system service or another process accesses the disk or network on your behalf.

[Android Documentation]

Requirements

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