开发者

ACTION_PICK usage with contact book

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);
    startActivityFo开发者_运维问答rResult(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).


You need to do this in a two-step processes. First pick the ID, and let that come back to your activity. Then launch a new intent to view that ID.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜