Android TextEvent For A Value Changed Help
So I've got this great piece of code that I use in a Java program
// Textlistener for the keyword "keyword"
public void textValueChanged(TextEvent e){开发者_StackOverflow社区
if (text.getText().toLowerCase().contains("keyword")){
parseInput(text.getText());
text.setText("");
}
}
Problem is, the wonderful Android OS changes pretty much all Java. /frustration
Could someone point me in the right direction? I'm currently using an EditText field to input the text, and want to immediately take it if the keyword is entered.
Implement a TextWatcher and stick it onto your EditText view with addTextChangedListener().
http://developer.android.com/reference/android/text/TextWatcher.html
精彩评论