开发者

I want to detect new line from the text view.

开发者 https://www.devze.com 2023-02-12 08:06 出处:网络
How can I detect new lin开发者_Python百科e character from the text view in android?I\'m not sure if I understand your question completely but you could always get the contents of the TextView using it

How can I detect new lin开发者_Python百科e character from the text view in android?


I'm not sure if I understand your question completely but you could always get the contents of the TextView using it's getText() method then use the String methods such as contains("\n") or replace("\n", "<new stuff>") to check for new lines and process it. Then you can just set the text in the TextView to the new string using setText().

0

精彩评论

暂无评论...
验证码 换一张
取 消