Skip to content

Instantly share code, notes, and snippets.

@barikoi
Created May 8, 2023 05:27
Show Gist options
  • Save barikoi/4a6a5ac1bab73cf2d91734a4cf08ad0d to your computer and use it in GitHub Desktop.
Save barikoi/4a6a5ac1bab73cf2d91734a4cf08ad0d to your computer and use it in GitHub Desktop.
ReverseGeoAPI.builder(getApplicationContext())
.setLatLng(Double.parseDouble(lat.getText().toString()),Double.parseDouble(lon.getText().toString()))
.setAdditionalParams(new ReverseGeoParams[]{DISTRICT, ADDRESS_COMPONENTS})
.build()
.getAddress(new ReverseGeoAPIListener() {
@Override
public void reversedAddress(ReverseGeoPlace place) {
Toast.makeText(MainActivity.this, ""+place.getAddress()+ " "+place.getAddressComponents().getHouse()+" "+place.getDistrict(), Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(String message) {
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment