Open the contact picker activity with a specific contact defaulty selected

by elDoudou » Tue, 01 Apr 2008 15:18:35 GMT


Sponsored Links
 I would like to know whether this is possible to open the contacts
picker activity and have a specific contact selected? I use the
following snippet of code:

  startSubActivity(new Intent(Intent.PICK_ACTION,
Contacts.People.CONTENT_URI), 0);

in order to open the activity, and it works perfectly. I tried:

  ContentURI peopleUri = Contacts.People.CONTENT_URI;
  peopleUri.addId(3);
  startSubActivity(new Intent(Intent.PICK_ACTION, peopleUri), 0);

(3 being a real contact id) but this does not change the default
selected contact.

Your help is appreciated (this is the kind of detail that makes the OS
user-friendly).
Regards, Edouard
--~--~---------~--~----~------------~-------~--~----~



Open the contact picker activity with a specific contact defaulty selected

by Peli » Tue, 01 Apr 2008 16:06:45 GMT


 Without having it tried out, I'm surprised that the second solution
works at all?
AFAIK, PICK_ACTION works on the mime-type vnd.android.cursor.dir/...
while adding the specific contact id changes this to the mime-type
vnd.android.cursor.item/... on which one should probably use the
GET_CONTENT_ACTION?

Regardless of my irritation, your feature seems like a useful one that
does not seem to be covered by the way the system works currently...
Maybe someone should invent a new intent for doing exactly what you
want  (PICK_WITH_PRESELECTION_ACTION)...

Peli
(PS: If Google doesn't do it, we should do it in OpenIntents..
 http://www.openintents.org  :-) )



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to refresh or update gridview by code

Hello,
I implement a game OnlyOne on android (atached) when i using screen events
(click, changed selected ) the game is working, but i am implementing a task
witch will resolve the game, here is my problem i can not refresh the screen
or grid view by code, i don't know what is to refresh and don't konw how to.

help me!!!
Thanks!!!!!

-- 
Gustavo Porpino Coutinho

--~--~---------~--~----~------------~-------~--~----~

2. Anybody know permission's protectionlevel?

As I know, if I define my own permission, I can assign protectionlelel
to it.
But there are so many android permission, and  I don't know their
default protectionlevel, where can I find it?
Thanks!

--~--~---------~--~----~------------~-------~--~----~

3. Problems with 1.5 r1 on 64 bit Ubuntu 9.04?

4. Calling ListView.setSelection has no effect when called directly after adapter data was invalidated

5. How to chage the image of an image button when it is onfocus/onclick/onrelease

6. MediaRecorder setCamera function

7. Speech recognition - support for different languages