안드로이드 개발 질문/답변
(글 수 45,052)
검색은 아주...지겹게 했느데..뭔가 저랑 많이 틀리게들 구현하셔서...-_-
나만 이런건지..
저는 mapview를 하나의 엑티비티로 구현하지 않고 그냥 릴레이티브 레이아웃 안에 넣어서
특정 이벤트가 발생할때마다 VISIBLE, GONE으로 호출하고 사라지게 하는데요...
한번 찍었던 마크가 GONE이 되고 다시 VISIBLE이 되어도 보이네요...
마커 찍고 GONE 하고 다른 새로운 위치에 마커 찍고 VISIBLE 하면 전에 찍었던 마커도 같이 찍혀있다는 것이죠...
리스트 사이즈를 보면 무조건 찍을때는 리스트에 아무것도 없습니다..
size와 isEmpty 메소드로 다 확인을 했어요...
갱신이나 초기화를 해야하는거 같은데..
답답하네요...이거가지고 몇일째..추석도 고민하다가 걍 지나버렸고요..ㅠ.ㅠ
초보에게 광영을 내려주세요...ㅠ.ㅠ
public StiesOverlay_store(Drawable marker, Context context, LinearLayout linear, int suchtype) { super(marker); this.linear = linear; Double nowLat = null; Double nowLot = null; String sql1 = "select * from store"; cursor = DB.rawQuery(sql1, null); for (int i = 0; cursor.moveToNext(); i++) { zip[i] = cursor.getString(2); sName[i] = cursor.getString(3); Address1[i] = cursor.getString(4); Address2[i] = cursor.getString(5); Address3[i] = cursor.getString(6); Address4[i] = cursor.getString(7); Address5[i] = cursor.getString(8); telephone[i] = cursor.getString(9); ThisLat[i] = Double.parseDouble(cursor.getString(10)); ThisLot[i] = Double.parseDouble(cursor.getString(11)); } if (suchtype == 0) { nowLat = p.lat(); nowLot = p.lot(); map.getController().setZoom(10); } else if (suchtype == 1) { String sql = "select * from store where (address1 ='" + si_do + "'and address2 = '" + gu_gun + "' and s_name ='" + reS_name + "') group by s_name"; cursor = DB.rawQuery(sql, null); while (cursor.moveToNext()) { map.getController().setCenter( getPoint(Double.parseDouble(cursor.getString(10)), Double.parseDouble(cursor.getString(11)))); nowLat = Double.parseDouble(cursor.getString(10)); nowLot = Double.parseDouble(cursor.getString(11)); map.getController().setZoom(10); Log.i("394", "1"); } } else if (suchtype == 2) { String sql = "select * from store where (s_name='" + XWinStore[0] + "'and address2='" + XWinStore[2] + "') group by address2"; cursor = DB.rawQuery(sql, null); while (cursor.moveToNext()) { map.getController().setCenter( getPoint(Double.parseDouble(cursor.getString(10)), Double.parseDouble(cursor.getString(11)))); nowLat = Double.parseDouble(cursor.getString(10)); nowLot = Double.parseDouble(cursor.getString(11)); map.getController().setZoom(10); Log.i("409", "2"); } } Log.i("items.isEmpty", items.isEmpty() + ""); Log.i("items size", items.size() + ""); // 상점 위치~ for (int i = 0; i < dbRowCount; i++) { Location.distanceBetween(nowLat, nowLot, ThisLat[i], ThisLot[i], result); if (result[0] / 1000 < 30) { items.add(new OverlayItem(getPoint(ThisLat[i], ThisLot[i]), sName[i], Address1[i] + " " + Address2[i] + " " + Address3[i] + " " + Address4[i] + " " + Address5[i] + "*" + TransTelephone(telephone[i]))); } } Log.i("433 items size", items.size() + ""); populate();