In Android Browser link does not always execute onClick causing focus instead

后端 未结 5 2218
梦如初夏
梦如初夏 2021-02-09 07:51

I am trying to program a very standard JS behavior for a link using an HREF onClick handler, and I am facing a strange problem caused by what I believe to be focus/touch mode be

5条回答
  •  不思量自难忘°
    2021-02-09 08:43

    Try enabling Javascript on the webview.

    In the activity that holds the webview, try this...

    WebView wv = (WebView) findViewById(R.id.webview);
    wv.getSettings().setJavaScriptEnabled(true);
    

    I was having he same problem, but figured out it was because I did not enabled Javascript.

提交回复
热议问题