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         });  

  • 相关阅读:
    SQLServer 可疑
    String与Long互转
    洛谷 P5644
    洛谷 P3783
    洛谷 P4663
    洛谷 P3438
    Atcoder Grand Contest 054 题解
    迭代器失效问题
    Solution -「CF 232E」Quick Tortoise
    Solution -「NOI 2020」「洛谷 P6776」超现实树
  • 原文地址:https://www.cnblogs.com/fangxiang/p/2367615.html
Copyright © 2011-2022 走看看