Android StrictMode.ThreadPolicy.Builder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android StrictMode.ThreadPolicy.Builder class.

This code example shows how to use the following methods:build, detectDiskReads, detectDiskWrites
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.detectDiskReads();
        builder.detectDiskWrites();
        return builder.build();
    } 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, permitDiskReads, permitDiskWrites
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.permitDiskReads();
        builder.permitDiskWrites();
        return builder.build();
    } 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, detectNetwork
	 
	@TargetApi(11) 
	public static void beginLegacySection() { 
		if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) return; 
		originalPolicy = StrictMode.getThreadPolicy();
		Builder builder = new Builder();
		builder.detectNetwork()
		 .penaltyFlashScreen()
		 .penaltyLog();
		StrictMode.setThreadPolicy(builder.build());
	} 
	 
	@TargetApi(11) 
	public static void endLegacySection() { 
		if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) return; 
		if (originalPolicy != null) StrictMode.setThreadPolicy(originalPolicy);
		originalPolicy = null;
	} 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, detectNetwork
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.detectNetwork();
        return builder.build();
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, detectNetwork
	 
	@TargetApi(11) 
	public static void beginLegacySection() { 
		if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) return; 
		originalPolicy = StrictMode.getThreadPolicy();
		Builder builder = new Builder();
		builder.detectNetwork()
		 .penaltyFlashScreen()
		 .penaltyLog();
		StrictMode.setThreadPolicy(builder.build());
	} 
	 
	@TargetApi(11) 
	public static void endLegacySection() { 
		if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) return; 
		if (originalPolicy != null) StrictMode.setThreadPolicy(originalPolicy);
		originalPolicy = null;
	} 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, detectAll
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.detectAll();
        return builder.build();
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, permitNetwork
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.permitNetwork();
        return builder.build();
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, permitAll
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.permitAll();
        return builder.build();
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, permitCustomSlowCalls
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.permitCustomSlowCalls();
        return builder.build();
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:build, penaltyDeathOnNetwork
    } 
     
    @Override 
    @TargetApi(TARGET_VERSION)
    protected ThreadPolicy onUpdateThreadPolicy(Builder builder) {
        builder.penaltyDeathOnNetwork();
        return builder.build();
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android StrictMode.ThreadPolicy.Builder Questions & Answers:

See Code Examples for Android StrictMode.ThreadPolicy.Builder Methods: