Add Strict Mode - Android Android OS

Android examples for Android OS:System Model

Description

Add Strict Mode

Demo Code


//package com.java2s;
import android.os.StrictMode;

public class Main {
    protected static void AddStrictMode() {
        if (android.os.Build.VERSION.SDK_INT > 9) {
            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                    .permitAll().build();
            StrictMode.setThreadPolicy(policy);
        }/*from   www  .j  a  va  2  s. c  o m*/
    }
}

Related Tutorials