I am following this tutorial. I am making an android app for one of my domains, it is a very basic viewer that shows the homepage, users can navigate to other pages staying within the app (instead of the popup asking them witch browser to use) but, I also have telephone numbers in the site as links, for example in this .tel page you can hover the mouse over and see the calto:xxxxx when I click on the phone in a browser it brings me the dial as I wish. When I click on it on my webview app it also works by bringing up the dial app.
But after implementing the following code in order to open all the pages and links inside the app, it does not work. It gives me a message inside the app because I can't open it
// Force links and redirects to open in the WebView instead of in a browser
mWebView.setWebViewClient(new WebViewClient());
So I used this to make other requested domains (I would expect the phone numbers as well) open in another app, browser, (expecting the dial app as well) and it works for other sites but when I click on the phone number it only gives me this error and force closes the app
public class MyAppWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(Uri.parse(url).getHost().endsWith("html5rocks.com")) {
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
view.getContext().startActivity(intent);
return true;
}
}
The error
02-24 18:56:20.065 15423-15423/com.clicnet.bandeirantestel A/chromium﹕ [FATAL:jni_android.cc(271)] Check failed: false.
02-24 18:56:20.075 15423-15423/com.clicnet.bandeirantestel A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 15423 (bandeirantestel)
Any help appreciated Thanks