Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. String PaypalURl = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=xxxxxxxxxx";
  2. wv_paypalView = (WebView)findViewById(R.id.web_view_paypal);
  3. wv_paypalView.getSettings().setJavaScriptEnabled(true);
  4. wv_paypalView.getSettings().setDomStorageEnabled(true);
  5. wv_paypalView.getSettings().setUseWideViewPort(true);
  6. wv_paypalView.getSettings().setLoadWithOverviewMode(true);
  7. // 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");
  8. 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");
  9. wv_paypalView.setWebViewClient(
  10. new SSLTolerentWebViewClient()
  11. );
  12. wv_paypalView.loadUrl(PaypalURl);
  13.  
  14. private class SSLTolerentWebViewClient extends WebViewClient {
  15. @Override
  16. public boolean shouldOverrideUrlLoading(WebView view, String url) {
  17. view.loadUrl(url);
  18. return true;
  19. }
  20.  
  21. @Override
  22. public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
  23. handler.proceed(); // Ignore SSL certificate errors
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement