Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String PaypalURl = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=xxxxxxxxxx";
- wv_paypalView = (WebView)findViewById(R.id.web_view_paypal);
- wv_paypalView.getSettings().setJavaScriptEnabled(true);
- wv_paypalView.getSettings().setDomStorageEnabled(true);
- wv_paypalView.getSettings().setUseWideViewPort(true);
- wv_paypalView.getSettings().setLoadWithOverviewMode(true);
- // wv_paypalView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
- wv_paypalView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 4.4.2; ASUS_T00J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Mobile");
- wv_paypalView.setWebViewClient(
- new SSLTolerentWebViewClient()
- );
- wv_paypalView.loadUrl(PaypalURl);
- private class SSLTolerentWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- view.loadUrl(url);
- return true;
- }
- @Override
- public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
- handler.proceed(); // Ignore SSL certificate errors
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement