Galaxy SIII(4.0.4) や HTC Desire HD (2.3.5) などの一部の Android デバイスで奇妙な問題に直面しています。Web ビューを開くと、添付のスクリーンショットのように、元の入力の上に偽の入力がレンダリングされます。
何か案は?
前もって感謝します。
編集:
Java コード:
final Dialog dialog = new Dialog(PreferencesActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.some_dialog);
dialog.setCancelable(true);
final WebView premiumPurchasingView = (WebView) dialog.findViewById(R.id.purchaseWebView);
WebSettings webSettings = premiumPurchasingView.getSettings();
webSettings.setJavaScriptEnabled(true);
premiumPurchasingView.addJavascriptInterface(dialog, "Dialog");
premiumPurchasingView.addJavascriptInterface(new JavascriptInterface(PreferencesActivity.this), "Android");
premiumPurchasingView.addJavascriptInterface(PreferencesActivity.this, "Preferences");
premiumPurchasingView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
dialog.show();
final ProgressDialog progressDialog = ProgressDialog.show(
PreferencesActivity.this,
getResources().getString(R.string.preloader_title),
getResources().getString(R.string.preloader_content)
);
premiumPurchasingView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
super.onPageFinished(view, url);
}
});
premiumPurchasingView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result) {
new AlertDialog.Builder(view.getContext())
.setTitle("alert")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
result.confirm();
}
}).setCancelable(false).create().show();
return true;
}
});
premiumPurchasingView.loadUrl("URL HERE");
HTML コード:
<div id="redeemCode">
<input placeholder="phone number"type="text" id="gsm_phone" size="10" onkeypress="if(this.value.length > 9) return false;" name="gsm_phone" style="margin-top:18px; padding:8px 0 9px; width:100%; background-color:#ececec;-webkit-border-radius: 3px;-moz-border-radius: 3px; border-radius: 3px; border:1px solid #cccccc;color:black;font-size:18px;" />
</div>