Android编程实现WebView全屏播放的方法(附源码下载)

2019-12-10 19:51:53刘景俊
  •    if (xprogressvideo == null) {      LayoutInflater inflater = LayoutInflater.from(MainActivity.this); 
  •     xprogressvideo = inflater.inflate(R.layout.video_loading_progress, null);     } 
  •    return xprogressvideo;     } 
  •   //网页标题     @Override 
  •    public void onReceivedTitle(WebView view, String title) {     (MainActivity.this).setTitle(title); 
  •    }  //   @Override 
  • //  //当WebView进度改变时更新窗口进度  //   public void onProgressChanged(WebView view, int newProgress) { 
  • //    (MainActivity.this).getWindow().setFeatureInt(Window.FEATURE_PROGRESS, newProgress*100);  //   }   
  •  }   /** 
  •   * 处理各种通知、请求等事件    * @author 
  •   */   public class xWebViewClientent extends WebViewClient { 
  •    @Override     public boolean shouldOverrideUrlLoading(WebView view, String url) { 
  •     Log.i("webviewtest", "shouldOverrideUrlLoading: "+url);      return false; 
  •    }   } 
  •  /**    * 当横竖屏切换时会调用该方法 
  •   * @author    */ 
  •  @Override   public void onConfigurationChanged(Configuration newConfig) { 
  •   Log.i("testwebview", "=====<<< onConfigurationChanged >>>=====");     super.onConfigurationChanged(newConfig); 
  •    if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE){      Log.i("webview", " 现在是横屏1"); 
  •     islandport = false;     }else if(newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){