Why setting up strictMode not working in Application without handler

android

Solution

Ok guys, I have found the solution. Its a bug described he

http://code.google.com/p/android/issues/detail?id=35298

Problem

When I want to set strictMode in Application without handler - no effects in Activities. This code is working: ``` public class MyApp extends Appliction { @Override public void onCreate() { super.onCreate(); new android.os.Handler().post(new Runnable() { @Override public void run() { setup_strict_mode(); } }); } } ``` This code is NOT working (no strict mode enabled in Activities) ``` public class MyApp extends Appliction { @Override public void onCreate() { super.onCreate(); setup_strict_mode(); } } ``` Here is setup_strict_mode: ``` StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyDeath().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog().build()); ``` Though onCreate is running in UI thead, so why this is happening?

Original source