views:

51

answers:

2

I have an app which allows the user to select a contact via an ACTION_PICK Intent using code similar to this example.

This works fine, but the user can press the Search key and choose a contact from the search results. In this case, the picker brings up the contact view where the only actions available are email, call, etc.

I'd expect the searched-for contact to be returned to the calling Activity instead of the displaying the contact details. Is this possible?

A: 

Check out this class: http://developer.android.com/resources/samples/BusinessCard/src/com/example/android/businesscard/BusinessCardActivity.html

Here when the ContactPickerActivity returns, loadContactInfo is called. In that bindView() is called which brings up the details view. If you dont want to show the details view, skip calling bindView(). Directly use the ContactInfo info.

Megha Joshi
A: 

When you fire off the intent, make sure you are using startActivityForResult() not just startActivity(). It sounds like this may be your problem

matto1990