Partager via


StrictMode.EnableDefaults Method

Definition

Enable the recommended StrictMode defaults, with violations just being logged.

[Android.Runtime.Register("enableDefaults", "()V", "")]
public static void EnableDefaults ();
[<Android.Runtime.Register("enableDefaults", "()V", "")>]
static member EnableDefaults : unit -> unit
Attributes

Remarks

Enable the recommended StrictMode defaults, with violations just being logged.

This catches disk and network access on the main thread, as well as leaked SQLite cursors and unclosed resources. This is simply a wrapper around #setVmPolicy and #setThreadPolicy.

Java documentation for android.os.StrictMode.enableDefaults().

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