I have a map and I want the values, that I printed at markers, change during location such as latitude and longitude.Below it's the onLocationChanged
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
mGoogleMap.setInfoWindowAdapter(new CustomInfoWindowAdapter(Tab2Map.this.getActivity()));
LatLng latlng = new LatLng(location.getLatitude(), location.getLongitude());
String snippet = "SignalStrength:"+current+
'\n'+"Rsrp: " +MapRsrp+'\n'+"Rsrq: "+MapRsrq+'\n'+"Rssnr: "+MapRssnr+'\n'+latlng.toString();
mGoogleMap.addMarker(new MarkerOptions().position(latlng).title("Signal Info").snippet(snippet).icon(BitmapDescriptorFactory.defaultMarker(color)));
CameraPosition position = CameraPosition.builder().target(latlng).zoom(16).bearing(0).build();
mGoogleMap.moveCamera(CameraUpdateFactory.newCameraPosition(position));
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {}
@Override
public void onProviderEnabled(String provider) {}
@Override
public void onProviderDisabled(String provider) {}
};
The values that I want to refresh it is into String snippet
value. These values I take them from another class using the function below.
public void test(int LteSignalStrength,int LteRsrp,int LteRsrq,int LteRssnr,int LteCqi){
MapRsrp=LteRsrp;
MapRsrq=LteRsrq;
MapRssnr=LteRssnr;
MapCqi=LteCqi;
}
Anyone know how can I do this?Thank you.