How to Handle WebView in Android 4.2 and 4.1
<p>My Webview works in android 4.4.4 and higher.How can I handle it in all android devices?!
I mean I tried many ways to show PaymentGateWay in Webview but it`s just shown url address in webview page(Cant Load Url).how can I do it with this code?</p>

<pre><code>    WebSettings webSetting = wv.getSettings();
    webSetting.setJavaScriptEnabled(true);
    webSetting.setJavaScriptCanOpenWindowsAutomatically(true);
    final JavaScriptInterface JavaScriptInterface = new JavaScriptInterface(WebViewPaymentByBankActivity.this);
    wv.addJavascriptInterface(JavaScriptInterface, "Android");
    //webView.setWebChromeClient(new MyWebChromeClient());
    //webView.getSettings().setSupportMultipleWindows(true);
    //webSetting.setPluginState(WebSettings.PluginState.ON);
    //webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
    //webSetting.setDomStorageEnabled(true);
    webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
    webSetting.setAppCacheEnabled(true);

    wv.setWebChromeClient(new WebChromeClient() {

        public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result) {
            //Toast.makeText(WebViewPaymentByBankActivity.this, message, Toast.LENGTH_LONG).show();
            result.confirm();
            return true;
        }

        public void onProgressChanged(WebView view, int progress) {

            activity.setProgress(progress * 1000);
            if (progress == 100) {
            }
        }
    });

    wv.setWebViewClient(new WebViewClient() {
        @JavascriptInterface
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String urlNewString) {

            if (!loadingFinished) {
                redirect = true;
            }
            loadingFinished = false;
            wv.loadUrl(urlNewString);
            url_result = urlNewString;
            uri = Uri.parse(url_result);
            String[] result = url_result.split("://");
            protocol = result[0];
            host = result[1];

            if (protocol.equals("inapp")) {
                if (host.equals("Error")) {
                    Intent intent = new Intent(WebViewPaymentByBankActivity.this,PaymentActivity.class);
                    startActivity(intent);
                    WebViewPaymentByBankActivity.this.finish();
                }
                else if (host.equals("Success")) {
                    Constants.ck_pay=true;
                    BasketFragment.sum = 0;
                    BasketFragment.txt_view_badge.setText("");
                    BasketFragment.txt_view_badge.setVisibility(View.GONE);
                    PaymentActivity.txt_view_pay_total.setText("0");
                    PaymentActivity.txt_view_pay_payable.setText("0");
                    WebViewPaymentByBankActivity.this.finish();
                }
            }
            return false;
        }

        @Override
        public void onPageFinished(WebView view, String url) {
            if (!redirect) {
                loadingFinished = true;
            }

            if (loadingFinished &amp;&amp; !redirect) {
                //HIDE LOADING IT HAS FINISHED
            } else {
                redirect = false;
            }
            super.onPageFinished(view, url);
            view.clearCache(true);
        }

        @Override
        @JavascriptInterface
        public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
            super.onReceivedSslError(view, handler, error);
            handler.proceed();
        }
    });
}


public class JavaScriptInterface {
    Context mContext;

    /**
     * Instantiate the interface and set the context
     */
    JavaScriptInterface(Context c) {
        mContext = c;
    }

    /**
     * Show a toast from the web page
     */
    @JavascriptInterface
    public void paymentResponse(String toast) {
        Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
    }
}


    @Override
    @JavascriptInterface
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        // Check if the key event was the Back button and if there's history
        if ((keyCode == KeyEvent.KEYCODE_BACK)) {
            wv.goBack();
            Intent intent = new Intent(WebViewPaymentByBankActivity.this, PaymentActivity.class);
            startActivity(intent);
            WebViewPaymentByBankActivity.this.finish();
            return true;
        }
        // If it wasn't the Back key or there's no web page history, bubble up to the default
        // system behavior (probably exit the activity)
        Intent intent = new Intent(WebViewPaymentByBankActivity.this, PaymentActivity.class);
        startActivity(intent);
        WebViewPaymentByBankActivity.this.finish();
        return super.onKeyDown(keyCode, event);
    }
</code></pre>