@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); // decide whether it is tablet mode if (null != detail_container) { mTwoPane = true; // Make sure that we are not being restored from a previous state, // else we could end up with overlapping fragments. if (savedInstanceState == null) { getSupportFragmentManager() .beginTransaction() .add(R.id.detail_container, new DetailFragment(), DetailFragmentTag) .commit(); } } else { mTwoPane = false; } // Initialize Stetho Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); }
private void initStetho() { Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); }
@Override public void onCreate() { StrictModeUtil.init(); super.onCreate(); refWatcher = LeakCanary.install(this); mContext = this; ImageLoadProxy.initImageLoader(this); JUtils.initialize(this); new Thread( new Runnable() { @Override public void run() { mAllArea = AreaArrayDataHelper.getAll(mContext); } }) .start(); if (BuildConfig.DEBUG) { Logger.init().hideThreadInfo().setMethodCount(1).setLogLevel(LogLevel.FULL); } Stetho.initializeWithDefaults(this); Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); // 全局捕获异常 MyCrashHandler handler = MyCrashHandler.getInstance(); Thread.currentThread().setUncaughtExceptionHandler(handler); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_container); Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); Fragment mainFragment = getSupportFragmentManager().findFragmentById(R.id.frame_container); if (mainFragment == null) getSupportFragmentManager() .beginTransaction() .add(R.id.frame_container, MovieListFragment.newInstance()) .commit(); else if (findViewById(R.id.details_container) == null) { if (mainFragment instanceof MovieDetailsFragment) getSupportFragmentManager() .beginTransaction() .replace(R.id.frame_container, MovieDetailsFragment.newInstance()) .commit(); else if (mainFragment instanceof ReviewsFragment) getSupportFragmentManager() .beginTransaction() .replace(R.id.frame_container, ReviewsFragment.newInstance(id)) .commit(); else getSupportFragmentManager() .beginTransaction() .replace(R.id.frame_container, MovieListFragment.newInstance()) .commit(); } if (findViewById(R.id.details_container) != null) { Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.details_container); if (currentFragment == null) getSupportFragmentManager() .beginTransaction() .replace(R.id.details_container, MovieDetailsFragment.newInstance()) .commit(); else { if (currentFragment instanceof MovieDetailsFragment) getSupportFragmentManager() .beginTransaction() .replace(R.id.details_container, MovieDetailsFragment.newInstance()) .commit(); else { getSupportFragmentManager() .beginTransaction() .replace(R.id.details_container, ReviewsFragment.newInstance(id)) .commit(); } } } }
public static void init(final Context context) { if (mInitialized) return; Stetho.InitializerBuilder initBuilder = Stetho.newInitializerBuilder(context); initBuilder .enableDumpapp(Stetho.defaultDumperPluginsProvider(context)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context)); Stetho.initialize(initBuilder.build()); mInitialized = true; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); // OkHttpClient client = new OkHttpClient(); // client.networkInterceptors().add(new StethoInterceptor()); setContentView(R.layout.activity_portfolio); }
/** * Start the listening server. Most of the heavy lifting initialization is deferred until the * first socket connection is received, allowing this to be safely used for debug builds on even * low-end hardware without noticeably affecting performance. */ public static void initializeWithDefaults(final Context context) { initialize( new Initializer(context) { @Override protected Iterable<DumperPlugin> getDumperPlugins() { return new DefaultDumperPluginsBuilder(context).finish(); } @Override protected Iterable<ChromeDevtoolsDomain> getInspectorModules() { return new DefaultInspectorModulesBuilder(context).finish(); } }); }
@Override public void onCreate() { super.onCreate(); // Fabric.with(this, new Crashlytics()); sContext = this; Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build()) .build()); RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build(); Realm.setDefaultConfiguration(realmConfiguration); }
@Override public void onCreate() { super.onCreate(); WondersSQLiteHelper wondersSQLiteHelper = WondersSQLiteHelper.getInstance(getApplicationContext()); try { wondersSQLiteHelper.configureDataBase(); } catch (IOException e) { Log.e("bError", "Erro ao configurar a conexao com o banco de dados"); } setDefaultFont(); Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); }