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
번호 분류 제목 글쓴이 날짜 조회 수
57 System/OS [ms-sql] 서브스트링(substring), 프로시저(SP) 작성 예제 hooni 2013.04.23 41296
56 System/OS [linux] 네트웍 트래픽 모니터링(MRTG) hooni 2003.04.23 41732
55 Etc [용어] POC, Pilot, BMT에 대한 IT 업계에서 통용되는 의미 hooni 2014.01.02 41947
54 Develop [java] 스트러츠(Struts) 세팅 ㅋㅋ file hooni 2013.04.23 42351
53 Develop [ios] 미스터피자(Mr.pizza) 어플 file hooni 2013.04.23 42629
52 Develop [c++] BHO 프로그램 동작 원리.. 간단하게.. hooni 2013.04.23 43091
51 Develop [android] 화면 전환(가로/세로)시 설정 hooni 2013.04.23 43369
50 Develop [android] ListView+ArrayAdapter 테스트 hooni 2013.04.23 43897
49 Etc 스파이웨어(BHO) 탐지하는 방법.. hooni 2013.04.23 44398
» Develop [android] ArrayAdapter 테스트 파일 ㅎㅎ hooni 2013.04.23 45239
47 Develop [ios] 배열(NSArray) 연산과 간단한 애니메이션(split images) hooni 2013.10.31 45434
46 Develop [ios] UIAlertView 초간단 샘플 ㅎㅎ hooni 2013.10.14 46104
Board Pagination Prev 1 ... 89 90 91 92 93 94 95 96 97 98 Next
/ 98