title: Convert my localhost website into android app
body: <p>I want to create a web view of a localhost website or not online website how can I do that its picking online websites link but not localhost is there a way to do this?</p>
  
  <p>I have tried giving the link using localhost and ip but it’s not picking my website.</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  public class MainActivity extends AppCompatActivity {
   private WebView mywebview;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          mywebview = findViewById(R.id.webview);
          WebSettings webSettings = mywebview.getSettings();
          webSettings.getJavaScriptEnabled();
          mywebview.loadUrl("http://192.000.00.0/traveland/index.php");
          mywebview.setWebViewClient(new WebViewClient());
      }
  
      @Override
      public void onBackPressed()
      {
          if(mywebview.canGoBack())
          {
              mywebview.goBack();
          }
          else
          {
              super.onBackPressed();
          }
  
      }
  }
  </code></pre>
  
  <p>MainActivity.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
      &lt;WebView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:layout_editor_absoluteX="8dp"
          tools:layout_editor_absoluteY="8dp"
          android:id="@+id/webview"/&gt;
  &lt;/RelativeLayout&gt;```
  
  It shows all the online websites not the offline ones how can that be done?
  </code></pre>