연락처 이름과 전화번호로 list 만들기
Cursor cursor = managedQuery( Phone.CONTENT_URI,
new String[]{ Phone._ID, Phone.DISPLAY_NAME, Phone.DATA1 },
null,
null,
Phone.DISPLAY_NAME + " asc" );
SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter( this,
android.R.layout.simple_ist_item_2,
cursor,
new String[]{ Phone.DISPLAY_NAME, Phone.DATA1 },
new int[]{ android.R.id.text1, android.R.id.text2 } );
ListView listView = new ListView( this );
listView.setAdapter( cursorAdapter );
setContentsView( listView );
'프로그래밍 놀이터 > 안드로이드, Java' 카테고리의 다른 글
[android] default font 는 무엇인가요? (0) | 2012.11.02 |
---|---|
[android] 모든 국가 이름 가져오기 (2) | 2012.11.02 |
[android] 전화걸기 & sms 보내기 intent example (0) | 2012.10.30 |
[android] 현재 위치한 국가 이름 얻는 방법. (0) | 2012.10.29 |
[android] layout 폴더는 sub folder 를 가질 수 있나요? (0) | 2012.10.29 |
댓글