当前位置: 代码迷 >> Web前端 >> webView展示progress indicator
  详细解决方案

webView展示progress indicator

热度:395   发布时间:2012-08-22 09:50:35.0
webView显示progress indicator

? @Override?
public void onCreate(Bundle savedInstanceState) {?
? ?
super.onCreate(savedInstanceState);?
? ? getWindow
().requestFeature(Window.FEATURE_PROGRESS);?
?
? ? setContentView
(R.layout.browser);?
? ? currentURL
= BrowserActivity.this.getIntent().getExtras().getString("currentURL");?
?
? ?
try {?
? ? ? ? mWebView
= (WebView) findViewById(R.id.webview);?
? ? ? ? mWebView
.getSettings().setJavaScriptEnabled(true);?
? ? ? ? mWebView
.setWebViewClient(new browserActivityClient());?
? ? ? ? setProgressBarIndeterminateVisibility
(true);?
? ? ? ? mWebView
.loadUrl(currentURL);?
? ? ? ? setProgressBarIndeterminateVisibility
(false);?
? ?
} catch (Exception e) {?
? ? ? ?
Log.e(getClass().getSimpleName(), "Browser: " + e.getMessage());?
? ? ? ?
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();?
? ?
} ?
}?

  相关解决方案