Now that you can find your device’s location and display the real-time location on the map, it’s time to show your contacts’ locations on the map. The map can be accessed from any of the three other activities through the navigation bar. If the user accesses the map from either the contact list or the settings activities, the map should display all the contacts in the database on the map. If the user accesses the map from the contact activity, the map should display only that contact. Implementing the second display type requires coding the
ContactActivity to pass the current contact’s ID to the map.
Open ContactActivity.java and locate the
initMapButton method. This method is modified to pass the contact’s ...