Are you the android developer or user? And you are facing the issue err_unknown_url_scheme? Follow the methods given below to solve the issue.
Contents
Err_unknown_url_scheme is an error usually encountered when an application or website which you download attempts to collect some information from the device. Shortly, the WebView URL project cannot be authenticated.
The error screen can be stopped by some lines of code.
Add target=”_blank” in your URL href code.
Example: <a href=”mailto:hai@email.com” target=”_blank”>link text which need to added</a> (or) <a href=“tel:123-456-7890” target=”_blank”>Call Techmazza Admin</a>
If you are a developer or programmer, then follow code snippet to fix this issue.
Note: Check if you have specified a http or https prefix in the URL. Preferred to url as prefix: ftp: https: sftp: ‘scheme’
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if( url.startsWith(“http:”) || url.startsWith(“https:”) ) {
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
cordova.getActivity().startActivity(intent);
return true;
}else if (url.startsWith(WebView.SCHEME_TEL) ||
url.startsWith(“sms:”) ||
url.startsWith(WebView.SCHEME_MAILTO) ||
url.startsWith(WebView.SCHEME_GEO) ||
url.startsWith(“maps:”))
{
try {
Log.d(LOG_TAG, “loading in external app”);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
cordova.getActivity().startActivity(intent);
} catch (android.content.ActivityNotFoundException e) {
LOG.e(LOG_TAG, “Error opening external app ” + url + “: ” + e.toString());
}
}
If the error occurred in Android sceen, then add the below code.
Note: Add to AndroidManifest.xml
<uses-permission android:name=”android.permission.CALL_PHONE”/>
The code allows you to give permission to access the phone number.
If you want to disable the error in Android screen then the developer add the following snippet.
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
String url = "http://www.google.com";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webactivity);
final WebView webview = (WebView) findViewById(R.id.web1);
webview.loadUrl(url);
webview.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
if (url.startsWith("http") || url.startsWith("https")) {
return true;
}else {
webview.stopLoading();
webview.goBack();
Toast.makeText(MainActivity.this, "Unknown Link, unable to handle", Toast.LENGTH_SHORT).show();
}
return false;
}});}}
The error occurs both in Chrome or Android but the issue has to be fixed from developer end. And has to be tested by the tester. Nothing have to go with user end.
Do you want to generate a password online? Our Password generator Online tool is used…
Do you want to know how to fix the Java Mail Authentication Failed Exception in spring…
Do you want to know the sac code list in GST? Here you can get…
Are you meesho seller? Do you want to generate GST report for tax registration? Follow…
Are you want to create Listing On Meesho? In this article you are going to…
Do you want to know the Meesho Seller Registration Process? Follow the steps given in…