# Interface LocationSharedListener

public interface LocationSharedListener

Receives the location a `LocationButton` obtained.

One method, so it can be written as a lambda:

    LocationButton b = new LocationButton();
    b.addLocationSharedListener(loc -> {
        if (loc == null) {
            infoLabel.setText("Location not shared");
        } else {
            infoLabel.setText(loc.getLatitude() + ", " + loc.getLongitude());
        }
        infoLabel.getParent().revalidate();
    });

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `locationShared(Location location)`
  Invoked on the EDT once the button has finished, whether or not it produced a location.

- ## Method Details

  - ### locationShared

    void locationShared(Location location)

    Invoked on the EDT once the button has finished, whether or not it produced a location.

    ###### Parameters

    - `location`: the location the user shared, or null when they declined the request, no fix arrived before the button's timeout, or the platform's own control failed. The last of those can arrive without a tap: the platform opens its session when the control is attached, so it can fail before anyone touches the button.