안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요...
예전글중에 술땡이워니님 게시글 보고
new Contacts에 접근하는 방법을 사용했는데요..
Intent addContactIntent = new Intent(Contacts.Intents.Insert.ACTION, Contacts.People.CONTENT_URI);
addContactIntent.putExtra(Contacts.Intents.Insert.PHONE , "01354684"); // an example, there is other data available
startActivity(addContactIntent);
addContactIntent.putExtra(Contacts.Intents.Insert.PHONE , "01354684"); // an example, there is other data available
startActivity(addContactIntent);
sdk2.0이상의 버전에서는 위방법이 안되더라고요...
People이 없어져서 그런가.....;
Intent.ACTION_INSERT 를 어찌어찌 사용하면 될듯한데..방법을 모르겠네요...
한가지만 더 질문 드릴께요...
전화번호를 가지고 Contact정보를 알아오는 방법이 궁금합니다.
2.0이상의 버전으로요....
예전에 별문제없이 썼었던거 같은데...ContactsConstract로 바뀌면서 OTL
답변 부탁드려요~^^;
Cursor c = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI , null, null, null, null);
int numberFieldColumnIndex = c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
String num = c.getString(numberFieldColumnIndex);
이런식으로 하면 전화번호 가져올 수 있는것으로 알고 있습니다.
000-000-0000 이런식으로 가져옵니다.