super.onCreate(savedInstanceState); StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build());
@Override public void onCreate() { super.onCreate(); setThreadPolicy(new ThreadPolicy.Builder().detectAll().penaltyLog().build()); setVmPolicy(new VmPolicy.Builder().detectAll().penaltyLog().build()); } }
@Override public void onCreate() { super.onCreate(); Log.d(TAG, "onCreate start"); if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build()); } applicationComponent = DaggerApplicationComponent.builder() .applicationModule(new ApplicationModule(this)) .build(); //初始化Stetho BuildConfig.STETHO.init(this.getApplicationContext()); weatherApplicationInstance = this; //初始化ApiClient ApiConfiguration apiConfiguration = ApiConfiguration.builder() // .dataSourceType(ApiConstants.WEATHER_DATA_SOURCE_TYPE_MI) // .dataSourceType(ApiConstants.WEATHER_DATA_SOURCE_TYPE_KNOW) .dataSourceType(ApiConstants.WEATHER_DATA_SOURCE_TYPE_ENVIRONMENT_CLOUD) .build(); ApiClient.init(apiConfiguration); Log.d(TAG, "onCreate end"); }
private void initStrictMode() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder() .detectAll() // .penaltyDialog() // 弹出违规提示对话框 .penaltyLog() // 在logcat中打印违规异常信息 .build()); StrictMode.setVmPolicy( new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); } }
public static StrictMode.ThreadPolicy.Builder newThreadPolicyBuilderWithDefaults() { return new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog(); }
public void init() { if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyFlashScreen() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); } mApplicationGraph = ObjectGraph.create(); }
private void enabledStrictMode() { if (SDK_INT >= GINGERBREAD) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() // .detectAll() // .penaltyLog() // .penaltyDeath() // .build()); } } }
@SuppressLint("ObsoleteSdkInt") private void enabledStrictMode() { if (SDK_INT >= GINGERBREAD && SDK_INT < O_MR1) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build()); } }
@Override public void run() { StrictMode.ThreadPolicy threadPolicy = new StrictMode.ThreadPolicy.Builder().detectAll() .permitDiskReads() .permitDiskWrites() .penaltyLog() .build(); StrictMode.setThreadPolicy(threadPolicy); StrictMode.VmPolicy vmPolicy = new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build(); StrictMode.setVmPolicy(vmPolicy); } });
@Override protected void onCreate(Bundle savedInstanceState) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Flaggr flaggr = Flaggr.with(this); flaggr.init("MY_URL", "MY_LOCAL_URI", null); } }
@Override public void run() { StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); } });
private void enabledStrictMode() { if (SDK_INT >= GINGERBREAD) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() // .detectAll() // .penaltyLog() // .penaltyDeath() // .build()); } } }
private void setStrictMode() { if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build()); } }
private void enabledStrictMode() { if (SDK_INT >= GINGERBREAD) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() // .detectAll() // .penaltyLog() // .penaltyDeath() // .build()); } } // 获取ApplicationContext
@Override public void onCreate() { super.onCreate(); if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build()); } Once.initialise(this); } }
private void initStrictMode() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder() .detectAll() // .penaltyDialog() // 弹出违规提示对话框 .penaltyLog() // 在logcat中打印违规异常信息 .build()); StrictMode.setVmPolicy( new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); } }
@Override public void onCreate() { super.onCreate(); AppCompatDelegate.setDefaultNightMode(Preferences.Theme.getAutoDayNightMode(this)); AlgoliaClient.sSortByTime = Preferences.isSortByRecent(this); mRefWatcher = LeakCanary.install(this); if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyFlashScreen() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); } Preferences.migrate(this); TYPE_FACE = FontCache.getInstance().get(this, Preferences.Theme.getTypeface(this)); AppUtils.registerAccountsUpdatedListener(this); AdBlocker.init(this, Schedulers.io()); }
@Override protected void onCreate(Bundle savedInstanceState) { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build()); } super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GetOrComputeYearClass findYearClass = new GetOrComputeYearClass(); findYearClass.execute(); mYearClass = (TextView) findViewById(R.id.year_class); }
@Override public void onCreate() { super.onCreate(); Stetho.initializeWithDefaults(this); if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build()); StrictMode.setVmPolicy( new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() .build()); } JobManager.create(this).addJobCreator(new DemoJobCreator()); } }
private static void enabledStrictMode() { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() // .detectAll() // .penaltyLog() // .penaltyDeath() // .build()); } }