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();
    } 
 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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();
    } 
 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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;
	} 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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();
    } 
 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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;
	} 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android StrictMode.ThreadPolicy.Builder Questions & Answers:

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