zoukankan      html  css  js  c++  java
  • Webview

    1.进度条

    View Code 
     1 requestWindowFeature(Window.FEATURE_PROGRESS); 
     2 mWebView.setWebChromeClient(new WebChromeClient(){
     3 public void onProgressChanged(WebView view, int newProgress) 
     4 {
     5 Log.d("webview","progress "+String.valueOf(newProgress));
     6 activity.setTitle("Loading...");  
     7                 TestAPPActivity.this.setProgress(newProgress * 100);  
     8 if (newProgress == 100) 
     9     activity.setTitle(R.string.app_name);  
    10 }
    11 }
    12

    2.防止跳转默认浏览器

     1 mWebView.setWebViewClient(new WebViewClient() {  
     2             public void onReceivedError(WebView view, int errorCode,  
     3                     String description, String failingUrl) { // Handle the error  
     4             }   
     5   
     6             public boolean shouldOverrideUrlLoading(WebView view, String url) {  
     7                 view.loadUrl(url);  
     8                 return true;  
     9             }  
    10         });  

  • 相关阅读:
    Bookmarks_www2
    Linux系统各发行版镜像下载(持续更新)
    tiny-rtems-src
    rtems-os-source
    OpenRCT2-ext
    PAT甲级1004题解——并查集思想改
    PAT甲级1008水题飘过
    PAT甲级1007题解——贪心
    PAT甲级1006水题飘过
    PAT甲级1005水题飘过
  • 原文地址:https://www.cnblogs.com/fangxiang/p/2367615.html
Copyright © 2011-2022 走看看