0

I was able to use ACTION_PICK with People.CONTENT_URI with the following part of code

    Uri myPerson = People.CONTENT_URI;
    Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,myPerson);
    startActivityForResult(contactPickerIntent, CONTACT_ACTIVITY_CODE);

With this I was able to launch the native contact book and on selecting a contact it returned th _ID of that contact. Now what I want is to display the next screen of contact book--the page specific to that selected contact. I tried with the following code. but did not work

    Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 23);
    Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,myPerson);
    startActivityForResult(contactPickerIntent, CONTACT_ACTIVITY_CODE);

Here if I change Intent.ACTION_PICK to ACTION_VIEW I am able to view the reqd screen. But I want that screen with ability to return my selection(which will be a phone number or email etc).

4

1 回答 1

0

您需要分两步执行此操作。首先选择 ID,然后让它回到您的活动中。然后启动一个新的意图来查看该 ID。

于 2011-01-04T20:22:57.827 回答