[英]How can I get the text out of a <textarea> tag in Android WebView?
我對HTML一無所知,並且正在學習Android WebView
。
在我的應用程序中,它使用WebView
顯示一個HTML文件。 在html中有一行:
<textarea cols="" id="system_text" style=" border-style: none; border-width: 0px; width:300px; height:120px;"></textarea>
當用戶單擊按鈕時,我應該將用戶輸入存儲在某處。 但是我不知道如何提取文本。 我知道如何從EditText
獲取文本,但是我對WebView
不了解。 有人可以幫我嗎?
您可以使用JSOUP開源的html解析器,然后可以像這樣寫String my_text = getElementByTagName("textarea").text();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.