How do I work with whatever the user enters into an EditText, in Java? For just one example, maybe the user enters "I had a great time this weekend!" into an EditText (like a Facebook update or Tweet). I want to do something with "I had a great time this weekend!" so how do I use Java to affect it in the app????
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- Illegal to have multiple roots (start tag in epilo
- How to maintain order of key-value in DataFrame sa
You can use this code also:
This should work:
Replace editTextID with the ID for your EditText.
You can get a value back from an
EditText
withI recommend
.trim()
'ing this value, since you probably don't want the trailing whitespace users tend to leave.You should use a
Button
onClick event to call the above methods, because it's more or less likely to be the UX you are looking for.use this code for get data from Edit text