Code example for Address

Methods: getLatitude, getLongitude

0
    public void onGeocodingSuccess(Object sender, ArrayList<Address> result) {
        cleanUpAfterGeocoding(); 
        if (result.size() == 1) {
            String fmt = "Lat: %s, lon: %s";
            Address address = result.get(0);
            String text = String.format(fmt, address.getLatitude(), address.getLongitude());
            Toast.makeText(this, text, Toast.LENGTH_LONG).show();
            mEditText.setText(DefaultAddressFormatter.format(address, ", "));
        } else { 
            showDisambiguationDialog(result);
        } 
    } 
 
    @Override 
    public void onGeocodingFailure(Object sender) {
        Toast.makeText(this, R.string.geocoding_error_toast, Toast.LENGTH_LONG).show();
        cleanUpAfterGeocoding(); 
    } 
 
    @Override 
    public void onGeocodingCanceled(Object sender) {