我无法将 webview 应用程序中的进度条更改为 circle.the 应用程序在启动时崩溃..这是代码
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
WebSettings websettings = webview.getSettings();
websettings.setJavaScriptEnabled(true);
getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS); // Request progress circle
setProgressBarIndeterminateVisibility(true); // Show progress circle
// webview.setWebViewClient(new WebViewClient());
final Activity activity = this;
webview.setWebChromeClient(new WebChromeClient(){
public void onProgressChanged(WebView view, int progress) {
activity.setTitle("Loading...");
activity.setProgress(progress * 100);
if(progress == 100)
setProgressBarIndeterminateVisibility(false); // Hide progress circle when page loaded
activity.setTitle("Title");
}
});
if (savedInstanceState == null)
{
webview.loadUrl("http://www.proboards.com/");
}
}
有人可以帮忙吗?