Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public void findPlaces(View view) {
// collect data to set options
GeoCoordinate myLocation = posManager.getPosition().getCoordinate();
EditText editSteps = (EditText)findViewById(R.id.editSteps);
int noOfSteps;
try {
noOfSteps = Integer.valueOf(editSteps.getText().toString());
} catch (NumberFormatException e) {
// if input is not a number set to default of 2500
noOfSteps = 2500;
}
range = ((noOfSteps * 0.762f) / 2);
// create an exploreRequest and set options
ExploreRequest request = new ExploreRequest();
request.setSearchArea(myLocation, (int)range);
request.setCollectionSize(50);
request.setCategoryFilter(new CategoryFilter().add(Category.Global.SIGHTS_MUSEUMS));
try {
ErrorCode error = request.execute(new SearchRequestListener());
if( error != ErrorCode.NONE ) {
// Handle request error
}
} catch (IllegalArgumentException ex) {
// Handle invalid create search request parameters
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.