Skip to content Skip to sidebar Skip to footer

Snapchat Url Load Issue

I have integrated Follow us on Snapchat in my Android application and for that am displaying https://www.snapchat.com/add/danubeco URL in my default web view. This works fine in th

Solution 1:

Try this not load url on shouldOverrideUrlLoading and put condition for false this is working perfect

   WebSettings settings = webview.getSettings();
    settings.setJavaScriptEnabled(true);
    //ws.setJavaScriptEnabled(true);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);



webview.setWebViewClient(new WebViewClient() {

        public boolean shouldOverrideUrlLoading(WebView view, String url) {


            if( url.startsWith("http:") || url.startsWith("https:") ) {
                return false;
            }
          //  Log.i(TAG, "Processing webview url click..."+url);
         //  view.loadUrl(url);

            return true;
        }


        public void onPageFinished(WebView view, String url) {
            Log.e(TAG, "Finished loading URL: " + url);
            if (progressBar.isShowing()) {
                progressBar.dismiss();
            }


        }


        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {



        }
    });

    webview.loadUrl("https://www.snapchat.com/add/danubeco");

Post a Comment for "Snapchat Url Load Issue"