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(); 
            } 
        }); 
    }
}


?

  1. [android] ListView+ArrayAdapter 테스트

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

    Date2013.04.23 CategoryDevelop Byhooni Views47337
    Read More
  3. [android] ArrayAdapter 테스트 파일 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views45239
    Read More
  4. [mac] OSX(맥) 단축키 설명 ㅎㅎ

    Date2013.04.23 CategorySystem/OS Byhooni Views29561
    Read More
  5. [link] iOS(아이폰) 개발 관련 ㅋㅋ

    Date2013.04.23 CategoryEtc Byhooni Views21501
    Read More
  6. [js] 파이어폭스(Firefox;F/F)에서 outerHTML 작동하도록 만든 메소드

    Date2013.04.23 CategoryDevelop Byhooni Views16441
    Read More
  7. [java] 스트러츠(Struts) 세팅 ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views42351
    Read More
  8. [java] 날짜 계산 (Date, SimpleDateFormat)

    Date2013.04.23 CategoryDevelop Byhooni Views11850
    Read More
  9. [js] 인터넷 주소(URL) 인코딩 ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views11349
    Read More
  10. [js] jQuery 관련 문서 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views31221
    Read More
  11. [php] 몽이가 준 ajax 채팅 소스 ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views36176
    Read More
  12. [js] Text 중 URL 형식을 인식해 단축 URL로 변경

    Date2013.04.23 CategoryDevelop Byhooni Views8705
    Read More
Board Pagination Prev 1 ... 41 42 43 44 45 46 47 48 49 50 ... 98 Next
/ 98