I have an Activity in which I register the users and in this same Activity I have a Fragment that shows me the map of Google Maps, what I want is to be able to pass the data I collect from the Google Maps Fragment to the Activity for be able to save the data later in the database.
The data I collect from the Google Maps Fragment is the address, latitude and longitude. These three data I want to pass from the Fragment that is inside the Activity, to the Activity that contains the Fragment.
This is the code where I have the data I want to pass, which are: fulladdress, position.latitude and position.longitude.
The idea is that when you mark a point (markerOptions) in the Google Maps Fragment, the data is automatically transferred and the EditText box that says "Company address" is filled with the data obtained "fulladdress".
markerOptions
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN))
.title(fulladdress);
LatLng position = markerOptions.getPosition();
Toast.makeText(
getActivity(),
"Lat " + position.latitude + " "
+ "Long " + position.longitude,
Toast.LENGTH_LONG).show();
I hope you can help me, thank you very much!