Hi, I am currently retrieving coordinates from the GPS and storing the value in a global variable called GLOBAL_QC. After the coordinates are stored I set the Location Listener for the Provider. However when the location has been updated it changes the value of my global variable to the new coordinates even though I did not say to do so. Only one function call is made to the method in which i set the global variable.
// 1. Retrieving coordinates and setting it to a variable GLOBAL_QC
--------------------------------------------------------------------
try{
location = locProvider.getLocation(-1);
if(location.isValid())
{
GLOBAL_QC = location.getQualifiedCoordinates();
}
locProvider.setLocationListener(new LocationListenerImpl(),1, 1, 1);
}catch(Exception e){
e.printStackTrace();
}
//2. Location Updated method does nothing
-----------------------------------------------------------------
private class LocationListenerImpl implements LocationListener
{
public void locationUpdated(LocationProvider provider, Location location)
{}
}

Reply With Quote

