조회 수 45286 추천 수 0 댓글 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. [vb] 비쥬얼 베이직 기출 문제 연습2

    Date2003.04.23 CategoryDevelop Byhooni Views54434
    Read More
  2. [iphone] view에 대한 조사 ㅡ,.ㅡ;

    Date2013.04.23 CategoryDevelop Byhooni Views54107
    Read More
  3. [vb] 비쥬얼 베이직으로..

    Date2003.04.23 CategoryDevelop Byhooni Views53106
    Read More
  4. [linux] 아파치설치/설정 - 알리어싱(aliasing)

    Date2003.04.23 CategorySystem/OS Byhooni Views51444
    Read More
  5. [android] GCM 사용하기 1 (GCM 서비스 신청하기)

    Date2013.07.06 CategoryDevelop Byhooni Views51417
    Read More
  6. [Android] 제스처 자료..

    Date2013.05.28 CategoryPPT Byhooni Views51125
    Read More
  7. [windows] 98/ME 속도 빠르게 튜닝(부팅,메모리,레지스터)

    Date2003.04.23 CategorySystem/OS Byhooni Views50521
    Read More
  8. [linux] 우분투 APM + phpmyadmin 설치

    Date2013.10.07 CategorySystem/OS Byhooni Views49390
    Read More
  9. [linux] CentOS 6.x Cati 설치 (yum)

    Date2014.01.17 CategorySystem/OS Byhooni Views48657
    Read More
  10. HTTP 프로토콜 (브라우저와 웹서버 간의 통신)

    Date2003.04.23 CategorySystem/OS Byhooni Views48340
    Read More
  11. [linux] Masquerade 가상 ip분할기법

    Date2003.04.23 CategorySystem/OS Byhooni Views47999
    Read More
  12. [android]개발 가이드 및 한글화 문서

    Date2013.04.23 CategoryDevelop Byhooni Views47555
    Read More
  13. [android] ArrayAdapter를 이용하여 출력하기

    Date2013.04.23 CategoryDevelop Byhooni Views47384
    Read More
  14. [ios] UIAlertView 초간단 샘플 ㅎㅎ

    Date2013.10.14 CategoryDevelop Byhooni Views46173
    Read More
  15. [ios] 배열(NSArray) 연산과 간단한 애니메이션(split images)

    Date2013.10.31 CategoryDevelop Byhooni Views45499
    Read More
  16. [android] ArrayAdapter 테스트 파일 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views45286
    Read More
Board Pagination Prev 1 2 3 4 5 ... 74 Next
/ 74