O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Capture User-Entered Data

The first new method needed is used to capture the user data as it’s typed and store it in the currentContact object. The method itself does not capture the data. Rather, it sets up listeners on all the EditTexts where data can be entered. If the text changes, the listener then executes the code to set the attribute that holds the code in the currentContact object. The method is called in the onCreate method of the ContactActivity so that the listeners are ready to go when the ContactActivity is ready for input. To start, enter the following line of code after all the other init methods in the onCreate method:

initTextChangedEvents();

Next, create a new method in the ContactActivity class called initTextChangedEvents() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required