Android WebView with load ProgressBar

It usually difficulty internet environment on mobile device. Sometimes angry for don't know the loading status. Maybe device be like angry bird fly on air. The feedback is very very important.

How to get WebView status Sample as below
webView = (WebView) findViewById(R.id.index_webview);
webView.loadUrl("YOUR_URL");
webView.setWebChromeClient(new WebChromeClient(){
public void onProgressChanged(WebView view, int progress) {
//Make the bar disappear after URL is loaded, and changes string to Loading...
if(newProgress <= 10){ //TODO something } // Return the app name after finish loading if(progress == 100){ //TODO something } } });

Reference
Android Developer
Android Developer - WebView

沒有留言:

張貼留言