Contents

조회 수 45242 댓글 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. [Xcode] 디버깅 옵션

    Date2013.04.23 CategoryDevelop Byhooni Views57200
    Read More
  2. [vb] 비주얼 베이직 205페이지

    Date2003.04.23 CategoryDevelop Byhooni Views56037
    Read More
  3. [vb] 비쥬얼 베이직 기출 문제 연습

    Date2003.04.23 CategoryDevelop Byhooni Views55134
    Read More
  4. [vb] 비주얼 베이직 173페이지

    Date2003.04.23 CategoryDevelop Byhooni Views54803
    Read More
  5. [vb] 비쥬얼 베이직 기출 문제 연습2

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

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

    Date2003.04.23 CategoryDevelop Byhooni Views53001
    Read More
  8. [android] GCM 사용하기 1 (GCM 서비스 신청하기)

    Date2013.07.06 CategoryDevelop Byhooni Views51356
    Read More
  9. [android]개발 가이드 및 한글화 문서

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

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

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

    Date2013.10.31 CategoryDevelop Byhooni Views45453
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71