1

I have created a WebView of this website https://smartfix.pk/ but in my app, WhatsApp is not working, when I click it gives me the error

enter image description here

webpage at whatsapp://send/?phone=923005475032&text=Hello%2C%20I%20have%20a%20question%20about%20SmartFix%20Services could not be loaded because: net::ERR_UNKNOWN_URL_SCHEME

public class MainActivity extends AppCompatActivity { WebView web; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); web = findViewById(R.id.webView); WebSettings webSettings = web.getSettings(); webSettings.setJavaScriptEnabled(true); web.setWebViewClient(new Callback()); web.loadUrl("https://smartfix.pk/"); } private class Callback extends WebViewClient { @Override public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) { return false; } } } 
3
  • You are exposing your personal numbers here.. Please blur it out before posting it in SO Commented Jun 18, 2022 at 17:55
  • There is no issue in your webpage. Actually you've to change your website. Which framework and language you've used for website? I've done such work in Laravel php. Commented Jun 19, 2022 at 6:44
  • @MuhammadFarhanArif Website is developed in Laravel PHP. Now tell me how I can solve it. Commented Jun 19, 2022 at 18:06

1 Answer 1

1

try to add this, i'm not sure it's will work for that page but when i'm using webview i always enable all to be sure

webSettings.setLoadsImagesAutomatically(true); webSettings.setDatabaseEnabled(true); webSettings.setDomStorageEnabled(true); webSettings.setJavaScriptEnabled(true); webSettings.setJavaScriptCanOpenWindowsAutomatically(true); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) { webSettings.setAllowFileAccessFromFileURLs(true); webSettings.setAllowUniversalAccessFromFileURLs(true); } 
Sign up to request clarification or add additional context in comments.

2 Comments

I appreciate your time, tried this also but still not solved.
@SyedShahrose then check it's link entered ok

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.