Contents

조회 수 45239 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

ArrayAdapter 샘플 코드

public class ArrayAdapterTest2 extends ListActivity {
    ArrayList<String> aList = new ArrayList<String>();

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        for(int i=0; i<100; i++){
            aList.add("haha"+i);
        }

        ArrayAdapter<String> aA =
            new ArrayAdapter<String>(this, R.layout.list_item, aList);
        
        setListAdapter(aA);

        ListView lv = getListView();
        lv.setTextFilterEnabled(true);

        lv.setOnItemClickListener(new OnItemClickListener() { 
            public void onItemClick(AdapterView<?> parent, View view, 
            int position, long id) { 
              // When clicked, show a toast with the TextView text 
              Toast.makeText(getApplicationContext(),
                  ((TextView) view).getText(), Toast.LENGTH_SHORT).show(); 
            } 
        }); 
    }
}


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
801 Develop [c] pcapdump 파일 분석 하는 프로그램.. ㅋㅋ file hooni 2013.04.23 6900
800 Develop [c] 소켓의 세가지 동작모드 hooni 2003.04.23 6902
799 Develop [c] 단기과정[01/10] 과제.. swap(any data, ..) file hooni 2003.04.23 6904
798 Develop [c] 맵서치인 듯(옛날 컴에서 찾은 자료) file hooni 2013.04.23 6904
797 Develop [c] 프로세스 정보 출력하기.. file hooni 2003.04.23 6906
796 Develop [php] 빔 프로젝터 예약 프로그램.. ㅋㅋ file hooni 2013.04.23 6918
795 Develop [c] 도메인(호스트)으로 IP정보 알아오기.. (nslookup과 비슷) file hooni 2013.04.23 6925
794 Develop [c] 단기과정[01/06] sizeof, 실수표현, 메모리, 연산자 hooni 2003.04.23 6927
793 Develop [c] 숫자 맞추는 게임.. file hooni 2013.04.23 6929
792 Develop [js] php의 number_format() 함수와 같은.. ㅋㅋ hooni 2013.04.23 6931
791 Develop [js] 네이버, 다음의 플레이어 스킨 file hooni 2013.04.23 6942
790 Develop 라이브러리에 대한 설명 (static & dynamic library) hooni 2013.04.23 6944
Board Pagination Prev 1 ... 27 28 29 30 31 32 33 34 35 36 ... 98 Next
/ 98