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
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week