The Scenario:
I have two fragments(each in a separate tab) doing work that's related to each other. For example:
public class A extends Fragment{
// Take user input and calculate a geo-location(this works fine)
// User can also mannually enter a location address and the geocoder
// figures out the Lat/Lng of that location.
// Uses a Asych task.
}
public class B extends Fragment{
// This a Google map. Based on Latitude & Longitude
// place a marker at that location(which is provided by class A.)
// Do other Stuff aswell
}
The problem:
I want to pass the location information to Class B. However I am having trouble with updating the map with the marker once I am finished calculating my location in class A. What I have seen is that the minute my app starts the class B onCreateView() method runs. This is where I would normally put my Marker functions information. However the Asych task from Class A takes some time to calculate the geolocation and therefore I don't have a Location to provide to the markers method in class B just yet. Is there anyway to add the marker to the map once the Asych task has completed without calling onCreateView() (for Class B) in class A again?
In other words
Can I somehow pass the Location information (for the markers method) and therefore drop a marker on the google map once my Asych task has completed.