public class GoodsDetailActivity extends Activity {
private static final int PROGRESS = 0x1;
private ProgressBar mProgress;
private WebView mWebView;
private int mProgressStatus = 0;
private Handler mHandler = new Handler();
private class MyWebChromeClient extends WebChromeClient{
public void onProgressChanged(WebView view, final int newProgress){
mHandler.post(new Runnable() {
public void run() {
mProgress.setProgress(newProgress);
}
});
super.onProgressChanged(view, newProgress);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MyApplication.getInstance().addActivity(this);
setContentView(R.layout.goods_detail_info);
mProgress = (ProgressBar) findViewById(R.id.goods_detail_progressbar);
mWebView = (WebView)findViewById(R.id.goods_detail_webview_content);
String url = "http://www.huawei.com";
mWebView.setWebChromeClient(new MyWebChromeClient());
mWebView.loadUrl(url);
}