Last active
September 10, 2023 08:57
-
-
Save barikoi/ff504f6cbc706db0282c66cf397d7c03 to your computer and use it in GitHub Desktop.
#docs #androidLibrary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NearbyPlaceAPI.builder(getApplicationContext()) | |
.setDistance(.5) // distance unit in KM | |
.setLimit(10) // return places list size | |
.setLatLng(latitude, longitude) | |
.build() | |
.generateNearbyPlaceListByType(new NearbyPlaceListener() { | |
@Override | |
public void onPlaceListReceived(ArrayList<NearbyPlace> places) { | |
Toast.makeText(MainActivity.this, ""+places.get(0).getAddress(), Toast.LENGTH_SHORT).show(); | |
} | |
@Override | |
public void onFailure(String message) { | |
Toast.makeText(MainActivity.this, "Error: "+message, Toast.LENGTH_SHORT).show(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment