With WebView, you need to install a listener for "input" events on the content editable element. (You need a content editable element to have editable content in WebView.) Here is an example in pure Java without any JavaScript code:

To be clear, for Document.getElementById to return something other than null, the document must contain an element with the same ID that you pass to Document.getElementById. In my example above, the ID is "editor". I see you want the entire body to be editable, so you need to assign the "editor" ID to the body element for Document.getElementById("editor") to return that element. Try this: