1

I have 'URL(href)' and 'Email(Mailto)' in a website and I need to make an application for that website. So I used 'webview' in Android application for it. When clicked on 'URLs' and 'Mailto' it opens in Web browser.

Could anyone have solution for this?

My code as follows:

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mywebview = (WebView) findViewById(R.id.webview);

    WebSettings webSettings = mywebview.getSettings();
    webSettings.setJavaScriptEnabled(true);

    mywebview.loadUrl("https://.com/");
    mywebview.setWebViewClient(new WebViewClient());
}
1737973
  • 159
  • 18
  • 42
Matt John
  • 11
  • 2

1 Answers1

0
 mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    mWebView.getSettings().setSupportMultipleWindows(true);
    mWebView.getSettings().setBuiltInZoomControls(false);
    mWebView.getSettings().setDisplayZoomControls(false);
    AppWebViewClients appWebViewClients = new AppWebViewClients(this, mProgressBar);
    mWebView.setWebViewClient(appWebViewClients);
    appWebViewClients.shouldOverrideUrlLoading(mWebView, knetUrl);