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 debug on device with Eclipse/ADB ?

I've been developing on the simulator, but now I have a real device.

adb can see the device (from adb devices), and I've installed Eclipse/
ADB.


I can't work out how to get debug to use the device instead of the
simulator though.

-- 

2. How to (properly) get device orientation data?

Hi,

I wanna thank you very much for your explanation. The official
documentation was very difficult to understand. And the example in the
api sample (the compass) does use a depreciated methods  (with
sensorlistener).

I don't understand what does remapCoordinateSystem and his parameters,
could you help?

Thank you.




-- 

3. notifyDataSetChanged() not updating listview after orientation change

4. Getting FileNotFound Exception when using FileReader

5. Extremely Simple Question

6. ListView refresh in ListActivity

7. ListView and CheckedTextView questions - help me, thanks!!!!