Contents

Views 46288 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

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


?

List of Articles
No. Category Subject Author Date Views
637 Develop [ios] TextField 특정 문자만 사용하도록 하기 hooni 2014.06.30 3889
636 Develop [ios] Thread Loop 내에서 UI 업데이트 방법 hooni 2015.01.03 2072
635 Develop [ios] Touch ID 적용 샘플 코드 (예제) file hooni 2015.02.23 1834
634 Develop [ios] UDID 사용 제한에 따른 대안들 hooni 2014.03.13 4973
633 Develop [ios] UDID와 UUID (디바이스의 Unique Identifier) file hooni 2013.04.23 28629
632 Develop [ios] UIAlertView 초간단 샘플 ㅎㅎ hooni 2013.10.14 55967
631 Develop [ios] UIButton multi-line iOS7 hooni 2014.01.09 13582
630 Develop [ios] UIColor 지정에서 RGB define ㅎㅎ hooni 2013.04.23 23817
629 Develop [ios] UILabel top alignㅎㅎ hooni 2013.04.23 23850
628 Develop [ios] UILabel with two different color text hooni 2024.12.14 4545
627 Develop [ios] UITableView 특정 Row만 Update hooni 2014.04.08 5792
626 Develop [ios] UIView에서 상위 UIViewController 가져오기 hooni 2013.09.27 23442
Board Pagination Prev 1 ... 41 42 43 44 45 46 47 48 49 50 ... 99 Next
/ 99