Thursday, September 9, 2010

Re: [android-developers] Can't select contact(s) on platforms 2.0 and above.

Hi Juan,

May be possible when you get a cursor with the contact information, there is some flag is set by default at the time of DB creation and when you collect data from DB, if flag is 0 then it's not visible to you else visible.

Batter you verify in People.CONTENT_URI what's the Data base Table creation Structure, i think here, they are setting some default Value with some corresponding fields.

rajesh


On Thu, Sep 9, 2010 at 10:09 PM, Mark Murphy <mmurphy@commonsware.com> wrote:
On Wed, Sep 8, 2010 at 4:26 PM, Juan Baez <jbaez001@odu.edu> wrote:
> I am having issues having the user selecting a contact via the Intent
> "ACTION_PICK" with the URI "People.CONTENT_URI" for Android platforms
> 2.0 and above.
>
> I create a new intent with the action "Intent.ACTION_PICK" for the URI
> "People.CONTENT_URI" -- from there I send a managedQuery to get a
> cursor with the contact information I need, which is the contact's
> name, and contact's phone number for the contact that the user
> selected.
>
> This works well on platforms 1.1 through 1.6. However, on platforms
> 2.0 through 2.2, this method no longer works for me.
>
> 2.2 - can't see the contact's phone number.
> 2.1-update1 - same as above.
> 2.0.1 - Can't see contact or phone number at all. When the intent is
> invoked, the user is encountered with "You have no contacts" even
> though he or she does.
> 2.0 - Same as above.
>
> Should I be doing something different for platforms 2.0 and above?
> I've searched around but to no avail.

You may wish to try a different Uri for 2.0+. Here is a sample project
demonstrating support for both Uri values:

http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Pick/

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment