Set Thread Strict Mode - Android Android OS

Android examples for Android OS:Thread

Description

Set Thread Strict Mode

Demo Code


//package com.java2s;

public class Main {
    public static void StrictMode09() {
        android.os.StrictMode/*from  w ww .  j ava 2 s. c o m*/
                .setThreadPolicy(new android.os.StrictMode.ThreadPolicy.Builder()
                        .detectDiskReads().detectDiskWrites()
                        .detectNetwork().penaltyLog().build());
        android.os.StrictMode
                .setVmPolicy(new android.os.StrictMode.VmPolicy.Builder()
                        .detectLeakedSqlLiteObjects().penaltyLog()
                        .penaltyDeath().build());
    }
}

Related Tutorials