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
)
public class RunFragment extends Fragment { private RunManager mRunManager; private Button mStartButton, mStopButton; private TextView mStartedTextView, mLatitudeTextView, mLongitudeTextView, mAltitudeTextView, ...
Get Android Programming: The Big Nerd Ranch Guide 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.