webView不能够显示网页。 Webpage not available。求大神指教

public class MainActivity extends Activity {
private String url = "http://www.hao123.com/";
private WebView webView;
private ProgressDialog dialog;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.web);

// Uri uri = Uri.parse(url);
// Intent intent = new Intent(Intent.ACTION_VIEW,uri);
// startActivity(intent);
init();
}

private void init() {
    // TODO Auto-generated method stub
    webView = (WebView) findViewById(R.id.webView);
    webView.loadUrl(url);
    webView.setWebViewClient(new WebViewClient(){
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            // TODO Auto-generated method stub
            view.loadUrl(url);
            return true;
        }
    });
    WebSettings settings = webView.getSettings();
    settings.setJavaScriptEnabled(true);
    webView.setWebChromeClient(new WebChromeClient(){
        @Override
        public void onProgressChanged(WebView view, int newProgress) {
            // TODO Auto-generated method stub
            if(newProgress == 100){
                closeDialog();
            }
            else{
                openDialog(newProgress);
            }
        }

        private void closeDialog() {
            // TODO Auto-generated method stub
            if(dialog != null && dialog.isShowing()){
                dialog.dismiss();
                dialog = null;
            }
        }
        private void openDialog(int newProgress) {
            // TODO Auto-generated method stub
            if(dialog == null){
                dialog = new ProgressDialog(MainActivity.this);
                dialog.setTitle("正在加载");
                dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
                dialog.setProgress(newProgress);
                dialog.show();
            }
            else{
                dialog.setProgress(newProgress);
            }
        }       
    });
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    // TODO Auto-generated method stub
    if(keyCode == KeyEvent.KEYCODE_BACK){
        Toast.makeText(this,webView.getUrl(),Toast.LENGTH_SHORT).show();
        if(webView.canGoBack()){
            webView.goBack();
            return true;
        }
        else{
            System.exit(0);
        }
    }
    return super.onKeyDown(keyCode, event);
}

}

注册文件已经加了权限。本来是可以加载网页的,制作了进度条判断页面的加载过程,就出错了。LOG显示08-25 03:01:29.029: E/cutils-trace(2289): Error opening trace file: No such file or directory (2)

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问