Last active
November 13, 2017 10:32
-
-
Save RBonaventure/a5259763722fa0e2e0dddef07658c43c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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