I have two arrays of double values called lat2[] and lon2[]. I have there stored the particular lattitude and longtitude values. And I can get those values as simple double values. My question is how can I find if this two doubles exist in the array (to check which marker has been clicked simply). Here is what I've done so far but it doesnt seem to work:
@Override
public boolean onMarkerClick(Marker marker) {
markerLatLng = marker.getPosition();
markerLat = markerLatLng.latitude;
markerLng = markerLatLng.longitude;
for (int i = 0; i < lat2.length; i++) {
if (markerLat == lon2[i]) {
for (int j = 0; j < lon2.length; j++) {
if (markerLng == lon2[j]) {
String title = marker.getTitle();
Log.e("TAG", " " + title);
}
}
}
}
return true;
}