Android EditText with TextWatcher (Searching data from ListView)Android EditText is a subclass of TextView. EditText is used for entering and modifying text. While using EditText width, we must specify its input type in inputType property of EditText which configures the keyboard according to input. EditText uses TextWatcher interface to watch change made over EditText. For doing this, EditText calls the addTextChangedListener() method. Methods of TextWatcher
Example of EditText with TextWatcher()In this example, we will implement EditText with TextWatcher to search data from ListView. activity_main.xmlCreate an activity_main.xml file in layout folder containing EditText and ListView. File: activity_main.xml Create another file list_item.xml in layout folder which contains data of ListView. list_item.xmFile: list_item.xml Activity classActivity class Output Next TopicAndroid Life Cycle of Activity |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India