Skip to content

Instantly share code, notes, and snippets.

@RBonaventure
Last active November 13, 2017 10:32
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 RBonaventure/a5259763722fa0e2e0dddef07658c43c to your computer and use it in GitHub Desktop.
Save RBonaventure/a5259763722fa0e2e0dddef07658c43c to your computer and use it in GitHub Desktop.
// Dans votre Activity#onCreate par exemple
mWebView.setWebViewClient(new WebViewClient() {
/*
* Le timer est démarré dès le chargement du contenu Web
*/
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
/*
* 'rendering_time' est le nom qui vous permettra
* d'identifier la Trace dans votre console Firebase
*/
mRenderingTrace = FirebasePerformance.getInstance().newTrace("rendering_time");
mRenderingTrace.start();
}
/*
* Et arrêté dès que celui-ci a été rendu à l'écran
*/
@Override
public void onPageFinished(WebView view, String url) {
mRenderingTrace.stop();
}
});
mWebView.loadUrl("https://www.bewizyu.com/");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment