ListView안에 getView 코드입니다.
해당 조건을 만족할 때 textView를 보여지게 하고, 그렇지 않은 경우에는 보이지 않게 하려고 하는데요.
view holder를 이용하니까 visible 세팅을 그대로 놔두면 그 다음 리스트 출력시에 view를 재사용 하면 조건이 맞지 않아도 그대로 나오더라고요.
그래서 else를 이용해서 invisible을 하게 되면 전체 리스트 중에서 마지막 하나만 text view가 보이네요.
어떻게 해야하나요..ㅠㅠ view holder를 쓰지 않고 계속 할당 받는 방법밖에 없는건가요ㅠㅠ
참고로 text view 에서 xml 파일 기본 값은 invisible입니다!
if(flag.equals("1") && (id .equals(data.getStationId()))) {
wrapper.getBusLocation().setVisibility(View.VISIBLE);
wrapper.getBusLocation().setText(location.get(i).getPlainNumber());
Log.v("bus---------->", id);
Log.v("bus2----------->", data.getStationId());
Log.v("flag::::::::", flag);
continue;
} else if(flag.equals("0") && (id.equals(next.getStationId()))) {
wrapper.getBusLocation().setVisibility(View.VISIBLE);
wrapper.getBusLocation().setText(location.get(i).getPlainNumber());
Log.v("bus---------->", id);
Log.v("bus2----------->", next.getStationId());
Log.v("flag::::::::", flag);
continue;
} else {
wrapper.getBusLocation().setVisibility(View.INVISIBLE);
}