自 4.3 版本以来,我在 android 中的付款 webview 出现问题。
我猜是由于 SSL 证书重定向,但我无法更改它。
我在三星或索尼 < 4.2 上成功尝试了 url,但在两个不同的 4.3 连接上我得到了这个转储。
08-08 17:22:38.619: E/AndroidRuntime(7568): FATAL EXCEPTION: WebViewCoreThread
08-08 17:22:38.619: E/AndroidRuntime(7568): java.lang.StringIndexOutOfBoundsException: length=0; index=-1
08-08 17:22:38.619: E/AndroidRuntime(7568): at java.lang.AbstractStringBuilder.indexAndLength(AbstractStringBuilder.java:212)
08-08 17:22:38.619: E/AndroidRuntime(7568): at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:206)
08-08 17:22:38.619: E/AndroidRuntime(7568): at java.lang.StringBuffer.charAt(StringBuffer.java:346)
08-08 17:22:38.619: E/AndroidRuntime(7568): at com.android.org.bouncycastle.asn1.x509.X509NameTokenizer.nextToken(X509NameTokenizer.java:78)
08-08 17:22:38.619: E/AndroidRuntime(7568): at com.android.org.bouncycastle.asn1.x509.X509Name.<init>(X509Name.java:719)
08-08 17:22:38.619: E/AndroidRuntime(7568): at com.android.org.bouncycastle.asn1.x509.X509Name.<init>(X509Name.java:655)
08-08 17:22:38.619: E/AndroidRuntime(7568): at com.android.org.bouncycastle.asn1.x509.X509Name.<init>(X509Name.java:593)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.net.http.SslCertificate$DName.<init>(SslCertificate.java:379)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.net.http.SslCertificate.<init>(SslCertificate.java:189)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.net.http.SslCertificate.<init>(SslCertificate.java:178)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.webkit.BrowserFrame.setCertificate(BrowserFrame.java:1206)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.os.Handler.dispatchMessage(Handler.java:99)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.os.Looper.loop(Looper.java:137)
08-08 17:22:38.619: E/AndroidRuntime(7568): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:814)
08-08 17:22:38.619: E/AndroidRuntime(7568): at java.lang.Thread.run(Thread.java:841)
我的网络视图很简单
webview=(WebView)findViewById(R.id.my_web_view);
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
多谢