Webview を使用して JavaScript 経由で関数を呼び出すアプリケーションがあります。Android OS 2.3 以降ではすべて問題ありませんが、2.2 以下ではサイレント エラーが発生します。私の webview コードを以下に貼り付けます。javascript ファイルには、次の単純なコールバックがあります。
<body onLoad='onLoad()'>
それは決してトリガーされません。何が間違っている可能性がありますか?
mMessageView = new WebView(main);
clearWebviewCache();
WebSettings mSettings = mMessageView.getSettings();
mSettings.setJavaScriptEnabled(true);
mMessageView.addJavascriptInterface(new DriverInterface(main), "messageView");
mMessageView.setWebChromeClient(new WebChromeClient(){
public void onProgressChanged(WebView view, int progress)
{
log("load progress = " + progress);
}
});