content: package com.wm.remusic.fragmentnet;
  
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  import com.wm.remusic.R;
  
  /**
   * Created by wm on 2016/4/12.
   */
  public class TopFragment extends Fragment {
      private WebView webView;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_top, container, false);
  
          webView = (WebView) view.findViewById(R.id.webview);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.getSettings().setUserAgentString("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36");
          webView.setWebViewClient(new WebViewClient() {
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
                  view.loadUrl(url); // 根据传入的参数再去加载新的网页
                  return true; // 表示当前WebView可以处理打开新网页的请求，不用借助系统浏览器
              }
          });
          webView.loadUrl("http://music.163.com/#/discover/toplist?id=19723756");
  
          return view;
      }
  }
  