WebView with loader in android example :
WebView with loader android example is used to show to loading bar when the webpage loading in the webview after the load complete the loader will disappear.
Simple steps to create Webview with loader,
1)Create webview in the xml layout,
<WebView
android:id="@+id/webView1"
android:layout_width="fill_parent" android:layout_height="fill_parent"/> |
2)Create the url you are going to load in the webview,
url="http://www.androidtoppers.com"; |
3)set the onLoadResource and onPageFinished by set the setWebViewClient in the webview,
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
progDailog.show();
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, final String url) {
progDailog.dismiss();
}
|
3)Finally,load the url in the webview,
webView.loadUrl(url); |
Screenshot:
No comments:
Post a Comment