When I click open in the instagram application in my application. My webview gives the following error:
Web page not available
Could not load webpage at address try: //instagram.com/_u/hotelcolonialdosnobres/#Intent; package = com.instagram.androi; scheme = https; end
net :: ERR_UNKNOWN_URL_SCHEME
In my webview I have this responsible role
webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// try{ url != null &&
if (url.startsWith("http://www.hotelcolonialdosnobres.com/")) {
view.loadUrl(url);
return true;
}
if (url.startsWith("mailto:") ||url.startsWith("intent://") || url.startsWith("market://") ){
try {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
final Activity host = (Activity) view.getContext();
host.startActivity(intent);
return true;
}catch (ActivityNotFoundException e) {
// Google Play app is not installed, you may want to open the app store link uri.getQuery())
// Uri uri = Uri.parse(url);
view.loadUrl(url);
return false;
}
}
return false;
}
});
How to fix this error so that it can open?