Updating the UI with Location Data

Just to verify that things are working as expected, add click listeners to the Start and Stop buttons in RunFragment that communicate with RunManager. Also add calls to a simple updateUI() method.

Listing 33.7  Starting and stopping location updates (RunFragment.java)

p​u​b​l​i​c​ ​c​l​a​s​s​ ​R​u​n​F​r​a​g​m​e​n​t​ ​e​x​t​e​n​d​s​ ​F​r​a​g​m​e​n​t​ ​{​

 ​ ​ ​ ​p​r​i​v​a​t​e​ ​R​u​n​M​a​n​a​g​e​r​ ​m​R​u​n​M​a​n​a​g​e​r​;​ ​ ​ ​ ​p​r​i​v​a​t​e​ ​B​u​t​t​o​n​ ​m​S​t​a​r​t​B​u​t​t​o​n​,​ ​m​S​t​o​p​B​u​t​t​o​n​;​ ​ ​ ​ ​p​r​i​v​a​t​e​ ​T​e​x​t​V​i​e​w​ ​m​S​t​a​r​t​e​d​T​e​x​t​V​i​e​w​,​ ​m​L​a​t​i​t​u​d​e​T​e​x​t​V​i​e​w​,​ ​ ​ ​ ​ ​ ​ ​ ​m​L​o​n​g​i​t​u​d​e​T​e​x​t​V​i​e​w​,​ ​m​A​l​t​i​t​u​d​e​T​e​x​t​V​i​e​w​,​ ...

Get Android Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.