I am making a simple application in which I have put a webview, but the page is loading very slow(tried with many websites) and also I want to add a progress bar so it should show that the page is loading.
Here is the code I am using for webview but I have no idea how to get progress bar on it:
public class MainActivity extends Activity {
WebView wv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
wv = (WebView) findViewById(R.id.webView1);
wv.setWebViewClient(new webCont());
wv.loadUrl(" http://www.abc.com" );
}
class webCont extends WebViewClient
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
return true;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…