Skip to content

Instantly share code, notes, and snippets.

@tugcearar
Created September 10, 2020 15:16
Show Gist options
  • Save tugcearar/a7d7c0ba83942c2e7e6c6fa6f2e78a7b to your computer and use it in GitHub Desktop.
Save tugcearar/a7d7c0ba83942c2e7e6c6fa6f2e78a7b to your computer and use it in GitHub Desktop.
public class NearbySearchResultListener : Java.Lang.Object, ISearchResultListener
{
private MainActivity context;
public NearbySearchResultListener(MainActivity context)
{
this.context = context;
}
public void OnSearchError(SearchStatus status)
{
Toast.MakeText(context, "Error Code: " + status.ErrorCode + " Error Message: " + status.ErrorMessage, ToastLength.Long);
}
public void OnSearchResult(Java.Lang.Object results)
{
NearbySearchResponse nearbySearchResponse = (NearbySearchResponse)results;
if (nearbySearchResponse != null && nearbySearchResponse.TotalCount > 0)
context.SetSearchResultOnMap(nearbySearchResponse.Sites);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment