What the title says. I have a webview that loads a survey with one question. After the user clicks/taps an answer on the page, a "thank you" appears (it seems as though the question elements are hidden and the thank you details become visible). The Thank You "page" is mostly blank and the user has no way of exiting the view (or page for that matter). I want to hide the webview after the user clicks an answer (or anywhere else for that matter), it still should accept the click before it is hidden. I have tried using:

```
// Find view
val webView: WebView = findViewById(R.id.web_view)

// Enable JS
val webSettings: WebSettings = webView.getSettings()
webSettings.javaScriptEnabled = true

// Load the page and set a listener to hide after a click.
webView.loadUrl(targetingResult.getSurveyUrl())
webView.setOnClickListener {
    it.visibility = View.INVISIBLE
}

```

but it doesn't work. I presume it's still accepting clicks on the page and not the view/webview itself. Some things to consider:

* The view takes up the entire activity/screen space. I can't add a button someplace to close the view.
* Ideally, the back button is not used.
* If your answer uses JS, please assume I have never used JavaScript (keep it concise and direct).
* Commented code is welcomed.

**TL;DR** - Hide a webview after the user clicks an element. Let the page do its thing while simultaneously hiding the webview.