Example usage for android.os StrictMode.ThreadPolicy.Builder StrictMode.ThreadPolicy.Builder

List of usage examples for android.os StrictMode.ThreadPolicy.Builder StrictMode.ThreadPolicy.Builder

Introduction

In this page you can find the example usage for android.os StrictMode.ThreadPolicy.Builder StrictMode.ThreadPolicy.Builder.

Prototype

StrictMode.ThreadPolicy.Builder

Source Link

Usage

From source file:org.mozilla.gecko.GeckoApp.java

/**
 * Enable Android StrictMode checks (for supported OS versions).
 * http://developer.android.com/reference/android/os/StrictMode.html
 *///www  . j a v  a2 s .  co  m
private void enableStrictMode() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
        return;
    }

    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());

    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
}