本文共 721 字,大约阅读时间需要 2 分钟。
build.gradle
debugCompile 'com.facebook.stetho:stetho:1.4.1' debugCompile 'com.facebook.stetho:stetho-okhttp3:1.4.1'
debug/java
public class DebugApplication extends App { @Override public void onCreate() { super.onCreate(); Stetho.initializeWithDefaults(this); }}
debug/manifest.xml
debug/java/OkHttpUtils
public class OkHttpUtils { public static OkHttpClient get() { return new OkHttpClient.Builder() .addNetworkInterceptor(new StethoInterceptor()) .build(); }}
release/java/OkHttpUtils
public class OkHttpUtils { public static OkHttpClient get() { return new OkHttpClient.Builder() .build(); }}
转载地址:http://xxsyb.baihongyu.com/