it视频网站:如何显示Youtube网站/视频中的网页视图?(How Do I Display Youtube site/video within Webview?)

  it视频网站:如何显示Youtube网站/视频中的网页视图?(How Do I Display Youtube site/video within Webview?)-U9SEO

  I am noob to android and i want to navigate youtube.com and show video from the site inside of a webview. Currenty, when i try to do this, the device’s browser 十二星座最近一周运势 appears 鍥涘窛鏁欏笀璧勬牸璇佹姤鍚嶇綉绔? and makes me navigate the site using the device browser. If the webview, is not capable of this type of functionality, how do i place the device’s default browser in my layout as i would a webview so that the site can be viewed within the application. Any help is greatly appreciated.

  My code so far:

  huffingtonpost=(WebView)findViewById(R.id.webView1);

  huffingtonpost.getSettings().setJavaScriptEnabled(true);

  huffingtonpost.getSettings().setUseWideViewPort(true);

  huffingtonpost.getSettings().setLoadWithOverviewMode(true);

  try{

  huffingtonpost.loadUrl(“http://www.youtube.com/KitcoNews”);

  }catch 三月二十号星座运势如何 (Exception e){

  e.printStackTrace();

  }

  解决方案

缃戠珯鐤儏鏈熼棿鍏嶈垂,

  Take a look at Handling Page Navigation which explains how to prevent Android from opening the default/stock browser. Quote below…

  When the user clicks a link from a web page in your WebView, the default behavior is for Android to launch an application that handles URLs. Usually, the default 2018年11月星座运势美国神婆网 web browser opens and loads the destination URL. However, you can override this behavior for your WebView, so links open within your WebView.