기존(2.0 이전) 에서는 Contacts.People 로 간단하게 주소록 저장 화면을 불러왔으나 Contacts.People이 Deprecated 된 관계로 사용이 권고 되지 않는다. 대체 방안으로 여러가지가 있으나 가장 손쉬운 방법은 ComponentName 을 이용해 직접 안드로이드 기본 패키지의 주소록 저장 Activity를 불러오게 할 수 있다. 대략적인 구동 소스는 다음과 같다. Intent intent = new Intent(Intent.ACTION_INSERT); ComponentName insertComponentName = new ComponentName( "com.android.contacts", "com.android.contacts.ui.EditContactActivity"); intent.setComponent(insertComponentName); Bundle bundle = new Bundle(); bundle.putString(Intents.Insert.PHONE, "000-000-0000"); bundle.putString(Intents.Insert.PHONE_TYPE, "전화번호타입1"); bundle.putString(Intents.Insert.SECONDARY_PHONE, "000-000-0000"); bundle.putString(Intents.Insert.SECONDARY_PHONE_TYPE, "전화번호타입2"); bundle.putString(Intents.Insert.NAME, "이름"); bundle.putString(Intents.Insert.COMPANY, "회사이름"); bundle.putString(Intents.Insert.JOB_TITLE, "부서이름"); intent.putExtras(bundle); startActivity(intent); 위 예제 외에도 다양한 옵션들로 주소록 저장 화면을 미리 채워 넣을 수 있다.
프로그래밍/안드로이드
[안드로이드 전화번호부 저장화면 Call] 스크랩 자료 연락처 추가 화면 호출하기
초보플밍지기
2012. 1. 2. 20:28