title: Supress default browser: Java, Android studio
body: <p>I'm setting up a simple AI, chat functions etc. Right now, I'm working on a small web view "browser". Opens up to google by default, then has a little textedit and button for further navigation. However, whenever a link is clicked on or I try to navigate, it opens the default browser instead. I tried using some code from simmilar questions, but it led to further issues so I removed it. Thanks for any help, here's my code:</p>
  
  <p>Xml, manifest, and method for button:</p>
  
  <pre><code>manifest file
   &lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name=".Main"
          android:configChanges="orientation|keyboardHidden|screenSize"
          android:label="@string/app_name"
          android:theme="@style/FullscreenTheme" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="comi.coding.prometheus.ignisai.Browser"
          android:parentActivityName="comi.coding.prometheus.ignisai.Main" &gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="comi.coding.prometheus.ignisai.Main" /&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;Button
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Browser"
              android:id="@+id/startBrowser"
              android:onClick="StartBrowser"
              android:layout_above="@+id/btnSay"
              android:layout_alignRight="@+id/lblOutput"
              android:layout_alignEnd="@+id/lblOutput" /&gt;
  
  public void StartBrowser(View view) {
              Intent intent = new Intent(this, Browser.class);
              startActivity(intent);
          }
  </code></pre>
  
  <p>Code for Browser.java(Second activity)</p>
  
  <pre><code>package comi.coding.prometheus.ignisai;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  public class Browser extends Activity {
      private WebView webView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Intent intent = getIntent();
  
          webView = (WebView) findViewById(R.id.webBrowser);
          webView.setWebViewClient(new MyWebViewClient());
  
          String url = "http://google.com";
          webView.getSettings().setJavaScriptEnabled(true);
          webView.loadUrl(url);
      }
  
      private class MyWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              view.loadUrl(url);
              return true;
          }
      }
  }
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>   11-11 20:38:34.831 24169-24169/? E/AndroidRuntime: FATAL EXCEPTION: main
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime: Process: comi.coding.prometheus.ignisai, PID: 24169
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime: java.lang.IllegalStateException: Could not execute method for android:onClick
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.support.v7.internal.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:278)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.view.View.performClick(View.java:4497)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:18590)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:733)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:136)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5021)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:  Caused by: java.lang.reflect.InvocationTargetException
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.support.v7.internal.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:273)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.view.View.performClick(View.java:4497) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:18590) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:733) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:136) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5021) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:  Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {comi.coding.prometheus.ignisai/android.provider.Browser}; have you declared this activity in your AndroidManifest.xml?
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1723)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1511)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.Activity.startActivityForResult(Activity.java:3424)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.Activity.startActivityForResult(Activity.java:3385)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.Activity.startActivity(Activity.java:3627)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.Activity.startActivity(Activity.java:3595)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at comi.coding.prometheus.ignisai.Main.StartBrowser(Main.java:251)
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.support.v7.internal.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:273) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.view.View.performClick(View.java:4497) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:18590) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:733) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:136) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5021) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643) 
  11-11 20:38:34.831 24169-24169/? E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method) 
  </code></pre>