Android : HTML in web-view when clicked is opening link in browser
<p>I am working on an Android project in which I am loading an HTML page from Internet, not locally and then displaying it in WebView. It works fine, but unfortunately, when I click on any of the element
in WebView, it opens the link in Browser. </p>

<p>What changes do I need to make so that any links clicked within the web-view will be opened by Web-view itself. Thank you.</p>

<p>Code :</p>

<pre><code>public class ContainerActivity extends Activity {

    private WebView mWebView;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.contain);

        mWebView = (WebView)findViewById(R.id.wvPortal);
mWebView.loadUrl("www.domain.com/path/to/index.html");
 WebSettings mWebSettings = mWebView.getSettings();

        mWebSettings.setJavaScriptEnabled(true);
} }
</code></pre>

<p>contain.xml :</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    &gt;
    &lt;WebView
        android:id="@+id/wvPortal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:background="@android:color/transparent"
        /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>Kindly let me know. Thank you. </p>