这是我的应用程序类,然后是 okhttp 初始化。除了网络调用,我能调试的所有东西
public class App extends BaseApp {
@Override
public void onCreate() {
ActivityLifecycleCallback.register(this);
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
.build());
}
}
这是 OkHttpClass
private static OkHttpClient okHttpClient = new OkHttpClient();
private static OkHttpClient getOkHttpClient() {
if (okHttpClient == null) {
okHttpClient = new OkHttpClient();
okHttpClient.networkInterceptors().add(new StethoInterceptor());
}
return okHttpClient;
}