Vishal
Vishal

Reputation: 999

Text Field in Android

I am developing an Android , which has a Text Field.

Every time user presses any key in the text field(EDIT TEXT), I want to to read that in a character variable, perform some action with that variable, and simultaneously empty the text field. In a way, it is a listener to that EditText Field which performs an operation with every key(character) pressed.

Any ideas on how to implement it?

Upvotes: 0

Views: 572

Answers (2)

Phil
Phil

Reputation: 36289

You will want to use a TextWatcher.

Upvotes: 1

Chris
Chris

Reputation: 3017

Implement and add a TextWatcher to your EditText: http://developer.android.com/reference/android/text/TextWatcher.html

Upvotes: 2

Related Questions