Contents

조회 수 45245 댓글 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] 최신 UI 모음.. (나중에 정리할 것)

    Date2013.08.09 CategoryDevelop Byhooni Views0
    Read More
  2. [ios] UI컨트롤러 샘플코드

    Date2013.08.08 CategoryDevelop Byhooni Views15426
    Read More
  3. [ios] libxml/tree.h file not found

    Date2013.08.08 CategoryDevelop Byhooni Views18710
    Read More
  4. [ios] 소소한 팁 (Rect,Point,Path,URL 등)

    Date2013.08.08 CategoryDevelop Byhooni Views29458
    Read More
  5. [ios] Background 에서 네트워크 사용

    Date2013.07.22 CategoryDevelop Byhooni Views11511
    Read More
  6. [ios] App States

    Date2013.07.22 CategoryDevelop Byhooni Views13196
    Read More
  7. 영어의 12 시제 (The twelve tenses of English)

    Date2013.07.12 CategoryEtc Byhooni Views15703
    Read More
  8. [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리

    Date2013.07.10 CategorySystem/OS Byhooni Views18799
    Read More
  9. git 브런치 배우기 (링크)

    Date2013.07.09 CategoryDevelop Byhooni Views20572
    Read More
  10. GCM 사용하기 3 (JSP로 GCM 푸시 서버 만들기)

    Date2013.07.06 CategoryDevelop Byhooni Views25317
    Read More
  11. GCM 사용하기 2 (단말에 GCM 구현하기)

    Date2013.07.06 CategoryDevelop Byhooni Views23249
    Read More
  12. [android] GCM 사용하기 1 (GCM 서비스 신청하기)

    Date2013.07.06 CategoryDevelop Byhooni Views51357
    Read More
Board Pagination Prev 1 ... 29 30 31 32 33 34 35 36 37 38 ... 98 Next
/ 98