for (int i = 0; i < clublatitude.size(); i++) {
Marker clubmarker1 = new Marker();
clubmarker1.setPosition(new LatLng(Double.valueOf(clublatitude.get(i)), Double.valueOf(clublongitude.get(i))));
clubmarker1.setIconTintColor(orangemarker);
clubmarker1.setTag(i);
clubmarker1.setMap(naverMap);
/********** CLUB MARKER CLICK LISTER ********/
clubmarker1.setOnClickListener(new Overlay.OnClickListener() {
@Override
public boolean onClick(@NonNull Overlay overlay) {
String tag = String.valueOf(overlay.getTag());
Intent intent = new Intent(getApplicationContext(), ClubMemberListActiivty.class);
intent.putExtra("clubname", clubname.get(Integer.valueOf(tag)));
startActivityForResult(intent, 1);
return false;
}
});
}
for (int i = 0; i < latitude.size(); i++) {
Marker marker = new Marker();
marker.setPosition(new LatLng(Double.valueOf(latitude.get(i)), Double.valueOf(longitude.get(i))));
marker.setIconTintColor(bluemarker);
marker.setTag(i);
marker.setMap(naverMap);
marker.setOnClickListener(new Overlay.OnClickListener() {
@Override
public boolean onClick(@NonNull Overlay overlay) {
String tag = String.valueOf(overlay.getTag());
Intent intent = new Intent(getApplicationContext(), PopupActivity.class);
intent.putExtra("name", name.get(Integer.valueOf(tag)));
intent.putExtra("number", phone_number.get(Integer.valueOf(tag)));
intent.putExtra("address", address.get(Integer.valueOf(tag)));
startActivityForResult(intent, 1);
return false;
}
});
It's a code that takes two kinds of markers on a map. However, the marker below is well photographed, but the club marker is not photographed. It's not that I can't take pictures continuously, but when I turn on the map screen, I sometimes take pictures and sometimes I don't take pictures.
android marker java naver-map
Use Thread.sleep or task.get Stop the main thread for a moment until the marker is finished
© 2024 OneMinuteCode. All rights reserved.