私はtouchevents
jsでいじっています。Eclipse の logcat でこのエラーが発生しました。
document.getElementById("squareBracket").
addEventListener("touchmove", touchHandler, false);
document.getElementById("squareBracket").
addEventListener("touchend", touchHandler, false);
function touchHandler(e) {
if (e.type == "touchstart") {
alert("You touched the screen!");
} else if (e.type == "touchmove") {
// alert(e.changedTouches[0].pageX);
// alert(e.changedTouches[0].pageY);
} else if (e.type == "touchend" || e.type == "touchcancel") {
alert('X :' + e.targetTouches[0].pageX);
alert('Y :' + e.targetTouches[0].pageY);
}
}
のコメントを削除するif
とtouchmove
、座標がポップアップします。ただし、コメントされている場合、logcat にエラーが表示されます。