Method updateStandard of Class MainActivity

Method updateStandard (Fig. 3.13) updates the 15% tip and total TextViews each time the user changes the bill amount. The method uses the billAmount value to calculate the tip amount and the total of the bill amount and tip. Lines 78–79 display the amounts in currency format.

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.