소스 형태가 이렇게 됩니다..
final Button button = (Button)findViewById(R.id.ItemButton); <---버튼
ListView listView = (ListView)findViewById(android.R.id.list); <---리스트 목록
ArrayList<HashMap<String, Button>> List = new ArrayList<HashMap<String, Button>>(); < 버튼와 리스트 묶음
HashMap<String, String> map = new HashMap<String, String>();
HashMap<String, Button> map1 = new HashMap<String, Button>();
map.put("ItemTitle","saasfsf");
map1.put("ItemButton",button);
List.add(map);
List.add(map1); 이 두분에서 문제가 생기는데요
SimpleAdapter mSchedule = new SimpleAdapter(this,alertsList,
R.layout.list_item,new String[] {"ItemTitle", "ItemButton"},
new int[] {R.id.ItemTitle,R.id.ItemButton});
어떻게 해결을 해야할지 모르겠습니다ㅠ
두개를 하나로 묶고 싶은데
결론적으로는 ==> list.add(map) 이렇게 하나로 묶어서 해결하고자 하는데요.. 방법좀 알려주세용;;
리스트어탭터를 해야한다는것은 알고 있습니다;; 다만.. 문제는 하는방법은 알고 있지만..어떻게 해야하는지를 모르겠습니다;;
http://www.androidpub.com/?mid=android_dev_qna&page=2&document_srl=174031
getView()라는 메서드를 오버라이드 해서 만들게됩니다.
ApiDemo에 보시면 view에서 Lists에서 14번 리스트가 오물오물님께서 원하는 리스트에 근접한 형태이지 싶은데요
소스코드 한번 살펴보세요 여기는 리스트의 포지션이 짝수냐 홀수냐에 따라 집그림 스피커그림을 앞에서 바꾸어주는
형태로군요 이것을 응용하면 원하는형태를 뽑아 내실수 있을듯 합니다. apiDemo사용방법 모르시면 여기 게시판 검색
하시면 나올겁니다.
HashMap<String, String> map = new HashMap<String, String>();
HashMap<String, Button> map1 = new HashMap<String, Button>();
두개를 포함하고 있는 Class A 라고 정의하고 안에 저 두개를 멤버 변수로 가지고 있고
ArrayList<HashMap<String, Button>> List = new ArrayList<HashMap<String, Button>>();
자료형 Button 을 A라고 적으면
ArrayList<HashMap<String, A>> List = new ArrayList<HashMap<String, Button>>();
두개다 포함 할수 있는 리스트가 만들어질꺼 같네요 .