I am trying to put GPS coordinates on TextView of a Fragment from MainActivity but I can not figure out how to do this.
I have:
MainActivity.java
LocationFragment.java
I want to update an TextView in LocationFragment from MainActivity's onLocationChanged()
method.
Is any chance to do this :
public void onLocationChanged(Location location) {
lat = (double) (location.getLatitude());
lng = (double) (location.getLongitude());
fragment.updateText(lat +" "+lng);
}