I'm trying to put GPS coordinates in a TextView from a snippet from MainActivity, but can't figure out how to do this.
I have:
MainActivity.java LocationFragment.java
I want to update a TextView in a LocationFragment from the MainActivity onLocationChanged() method.
Is there a chance to do this:
public void onLocationChanged(Location location) { lat = (double) (location.getLatitude()); lng = (double) (location.getLongitude()); fragment.updateText(lat +" "+lng); }
android android-activity android-fragments fragment
imuraretu Jun 20 '14 at 6:44 2014-06-20 06:44
source share