Skip to content

Instantly share code, notes, and snippets.

@wuapnjie
Last active April 17, 2016 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuapnjie/fa3900c4564cd700f26301914eb2021a to your computer and use it in GitHub Desktop.
Save wuapnjie/fa3900c4564cd700f26301914eb2021a to your computer and use it in GitHub Desktop.
Using Stetho to inspect picasso's network task
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
Stetho.initialize(Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
.build()
);
OkHttpClient client = new OkHttpClient();
client.networkInterceptors().add(new StethoInterceptor());
Picasso picasso = new Picasso.Builder(this)
.listener((picasso1, uri, exception) -> {
Log.e("Picasso", "picasso load image failed, uri -> " + uri, exception);
})
.downloader(new OkHttpDownloader(client))
.build();
Picasso.setSingletonInstance(picasso);
Picasso.with(this).setIndicatorsEnabled(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment