Contents

조회 수 46292 댓글 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(); 
            } 
        }); 
    }
}


?

  1. [ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)

  2. [android] GCM 사용하기 1 (GCM 서비스 신청하기)

  3. [linux] 아파치설치/설정 - 알리어싱(aliasing)

  4. [Android] 제스처 자료..

  5. [windows] 98/ME 속도 빠르게 튜닝(부팅,메모리,레지스터)

  6. HTTP 프로토콜 (브라우저와 웹서버 간의 통신)

  7. [linux] 우분투 APM + phpmyadmin 설치

  8. [linux] CentOS 6.x Cati 설치 (yum)

  9. [linux] Masquerade 가상 ip분할기법

  10. [android]개발 가이드 및 한글화 문서

  11. [android] ArrayAdapter를 이용하여 출력하기

  12. [linux] 네트웍 트래픽 모니터링(MRTG)

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 99 Next
/ 99