주소록 정보

|
  1.         String row = "";
  2.         int loopCount = 0;

  3.         Cursor contactsRow = getContentResolver().query(Phone.CONTENT_URI,
  4.          null,
  5.          null,
  6.          null,
  7.          null
  8.         );
  9.         
  10.         while(contactsRow.moveToNext()){
  11.          for(int i = 0; i < contactsRow.getColumnCount(); i++){
  12.          row += "\n" + contactsRow.getColumnName(i) + " : " + contactsRow.getString(i);
  13.          }
  14.         
  15.          row += "\n\n\n\n\n\n\n";
  16.         
  17.          if(loopCount++ >= 40){
  18.          break; 
  19.          }
  20.         }
  21.         
  22.         
  23.         TextView textArea = (TextView)findViewById(R.id.textArea);
  24.         textArea.setText(row);
data1 : 전화번호
전화번호 기준으로 row 생성됨

'Android' 카테고리의 다른 글

태스크란? (Task, Activity Stack)  (0) 2011.03.14
Custom Dialog 주소록 정보 출력  (0) 2011.02.08
SMS 정보  (0) 2011.02.01
content://sms/ 필드명  (0) 2011.02.01
Custom Dialog  (0) 2011.02.01
And