title: Load local html file in webview android
body: <p>I am trying to load the contents of a html file in a webview in android. However, it gives me the "Webpage not available error". If I try websites such as google or yahoo, they work.</p>
  
  <p>The html file are under src > main > assests > index.html</p>
  
  <p>Can someone help me with this issue. Thank You.</p>
  
  <p>Following is my code :</p>
  
  <pre><code>setContentView(R.layout.activity_main);
  
  WebView mWebView;
  mWebView = (WebView) findViewById(R.id.activity_main_webview);
  
  WebSettings webSettings = mWebView.getSettings();
  webSettings.setJavaScriptEnabled(true);
  
  mWebView.loadUrl("file:///android_asset/index.html");
  </code></pre>
  
  <p>XML File :</p>
  
  <pre><code>&lt;WebView
      android:id="@+id/activity_main_webview"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  </code></pre>