Webview に基づいて Android アプリケーションを開発しています。Android 4.1 ではすべて正常に動作していますが、4.4 ではこのエラーがスローされます。
01-29 11:16:03.075: E/eglCodecCommon(2179): glUtilsParamSize: 不明なパラメーター 0x00000bd0 01-29 11:16:03.095: E/eglCodecCommon(2179): * * エラー不明なタイプ 0x10037 (glSizeof,72)
この行のコメントを外すと、機能しますが (論理的に) 何も表示されません
webview.loadUrl("file:///android_asset/html/index.html");
Webview 構成コードは次のようになります。
webview = new WebView(this);
webview.clearCache(true);
webview.clearHistory();
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webview.setWebViewClient(new WebViewClient());
//webview.setWebChromeClient(new WebChromeClient());
webview.addJavascriptInterface(new JavaScriptInterface(this), "Android");
setContentView(webview);
webview.loadUrl("file:///android_asset/html/index.html");
HTMLコードは正確に
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="description" content="">
<meta name="author" content="">
<title>My Web App</title>
<script src="../js/jquery.js"></script>
<script src="../js/hammer.js"></script>
<script src="../js/lightboxes.js"></script>
<link href="../css/main.css" rel="stylesheet">
<link href="../css/lightboxes.css" rel="stylesheet">
<script type="text/javascript">
activeId = "contentOne";
passiveId = "contentTwo";
swiping = false;
function changeElements()
{
$("#" + passiveId).css("display", "none");
$("#" + passiveId).css("-webkit-transition", "-webkit-transform 0s linear");
$("#" + passiveId).css("-webkit-transform", "translate(150%,0)");
setTimeout(function() {
$("#" + passiveId).css("display", "block");
$("#" + passiveId).css("-webkit-transition", "-webkit-transform 0.25s ease-in-out");
swiping = false;
}, 10);
}
function nextPhrase()
{
if (!swiping)
{
swiping = true;
$("#" + activeId).css("-webkit-transform", "translate(-101%,0)");
$("#" + passiveId).css("-webkit-transform", "translate(2.5%,0)");
var result = Android.getPhrase();
document.getElementById(passiveId + "Text").textContent = result;
tempId = activeId;
activeId = passiveId;
passiveId = tempId;
setTimeout(changeElements, 600);
}
//$("#"+passiveId).css("-webkit-transition", "-webkit-transform 0.1s linear");
//$("#"+passiveId).css("-webkit-transform", "translate(-100%,0)");
//$("#"+passiveId).css("-webkit-transition", "-webkit-transform 0.6s ease-in-out");
//document.getElementById("next").style.backgroundColor="blue";
}
function rel()
{
document.getElementById("next").style.backgroundColor = "#FFF";
}
function changeColor(el)
{
document.getElementById("next").style.backgroundColor = "#EEE";
}
</script>
</head>
<body>
<div id="contentHeader">
Never I have ever ...
</div>
<div id="container">
<div id="contentOne">
<div id="contentOneText">
</div>
</div>
<div id="contentTwo">
<div id="contentTwoText">
</div>
</div>
</div>
<div id="headNav">
<div class="navElement" id="next" >
<div class="elName">
Next
</div>
</div>
</div>
<div id="proposalLightbox">sdfsdfasfasdf</div>
<div id="fade"></div>
<script>
Hammer(document).on("dragleft", function(e) {
nextPhrase();
});
document.getElementById('next').ontouchstart = function(eve) {
nextPhrase();
document.getElementById("next").style.backgroundColor = "#EEE";
}
document.getElementById('next').ontouchend = function(eve) {
//alert()
document.getElementById("next").style.backgroundColor = "#FFF";
}
var result = Android.getPhrase();
document.getElementById(activeId + "Text").textContent = result;
function testEcho(par)
{
alert(par);
}
function openProposeDialog(par)
{
showLightbox("proposalLightbox");
}
document.getElementById('fade').ontouchstart = function(eve) {
closeLightboxes();
}
//nextPhrase();
</script>
</body>
</html>
そしてJava-Javascriptインターフェースは
public class JavaScriptInterface {
Context mContext;
JavaScriptInterface(Context c) {
mContext = c;
}
public String showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
return toast;
}
public String getPhrase() {
String phrase = "";
//phrase = dataHandler.getRandomPhrase();
return phrase;
}
}
事前にどうもありがとう