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
번호 분류 제목 글쓴이 날짜 조회 수
385 Develop [js] 한글주소(URL) 인코딩(encode, Encoding), 자바스크립트(JavaScript) hooni 2013.04.23 11328
384 Develop [js] jQuery 관련 사이트 링크 모음 hooni 2013.04.23 18237
383 Develop [js] Text 중 URL 형식을 인식해 단축 URL로 변경 file hooni 2013.04.23 8705
382 Develop [php] 몽이가 준 ajax 채팅 소스 ㅋㅋ file hooni 2013.04.23 36176
381 Develop [js] jQuery 관련 문서 ㅎㅎ file hooni 2013.04.23 31221
380 Develop [js] 인터넷 주소(URL) 인코딩 ㅋㅋ hooni 2013.04.23 11349
379 Develop [java] 날짜 계산 (Date, SimpleDateFormat) hooni 2013.04.23 11850
378 Develop [java] 스트러츠(Struts) 세팅 ㅋㅋ file hooni 2013.04.23 42351
377 Develop [js] 파이어폭스(Firefox;F/F)에서 outerHTML 작동하도록 만든 메소드 hooni 2013.04.23 16441
» Develop [android] ArrayAdapter 테스트 파일 ㅎㅎ hooni 2013.04.23 45239
375 Develop [android] ArrayAdapter를 이용하여 출력하기 hooni 2013.04.23 47337
374 Develop [android] ListView+ArrayAdapter 테스트 hooni 2013.04.23 43897
Board Pagination Prev 1 ... 34 35 36 37 38 39 40 41 42 43 ... 71 Next
/ 71