Android layout is made with ViewGroup
s and View
s, and WebView
is a View
with own content, can't have childs like ViewGroup
s. text fields on rendered site aren't Androids EditText
s, they are just rendered and handled by Chromium engine. e.g. they have own default style and they may be styled by CSS, but for shure they won't be styled same as your EditText
s when you set some style for them "globally"
WebView
is a bit like VideoView
- yes, you can play a video, which contains just text printed on the middle of the screen, but this doesn't make VideoView
behave like TextView
. You can't e.g. change text color or select part of text for copying. whole content is rendered by another mechanism (which is huge and very complicated in both cases, working under the hood, probably running new threads or maybe even processes), just like Chromium renders web sites.
still you can try to get access to web content-text-fields with JS, using smth like below
webView.loadUrl("javascript:document.getElementByName('id_of_field').value = 'inserted text';");
don't forget to enable JS at first
webView.getSettings().setJavaScriptEnabled(true);
PS. Enable "Show layout bounds" in developer options and inspect how does you app looks like (or any other, or even system itself) and how looks web content (inside WebView
or any browser app)