전화번호부 불러오기 중..
main 에서 버튼을 클릭 하여 아래소스가 있는 phonelist 페이지로 넘어오게 했습니다.
그런데 주소록으로 넘어가더군요 ;; 제가 원하는건 본 앱자체에서 불러져와 화면에 출력 되기를 바라는데..
어떤 부분을 수정해야 앱자체에서 불러지는지 궁금합니다 ;;
public class phonelist extends Activity{
private DatabaseAdapter dbAdapter;
String mName;
String mNumber;
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
Cursor c = getContentResolver().query(Phone.CONTENT_URI, null, null, null, null);
startManagingCursor(c);
setContentView(R.layout.mpost_phonelist_people);
ListView LV = (ListView)findViewById(R.id.ListView01);
ListAdapter LA = new SimpleCursorAdapter(
this,
android.R.layout.simple_list_item_2, c,
new String[]{Phone.DISPLAY_NAME,Phone.NUMBER},
new int[] { android.R.id.text1, android.R.id.text2 });
LV.setAdapter(LA);
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setData(ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
startActivityForResult(intent, 0);
}
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setData(ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
startActivityForResult(intent, 0);
이 세줄만 지우시면 될 것 같습니다.