Skip to content

Instantly share code, notes, and snippets.

@muratcanbur
Created August 23, 2015 08:56
Show Gist options
  • Save muratcanbur/faf3b810a29950bfafab to your computer and use it in GitHub Desktop.
Save muratcanbur/faf3b810a29950bfafab to your computer and use it in GitHub Desktop.
Stetho Utility class
public final class StethoUtil {
private static boolean init = false;
private StethoUtil() {
}
public static void init(Context context) {
if (BuildConfig.DEBUG) {
Stetho.initialize(
Stetho.newInitializerBuilder(context)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(context))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))
.build());
init = true;
}
}
public static void addNetworkInterceptor(OkHttpClient client) {
if (init) {
client.networkInterceptors().add(new StethoInterceptor());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment