How do get the android sdk contact picker to give

2019-05-25 01:04发布

i get some pretty weird stuff when i try and use this:

Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, PICK_CONTACT);

my problem is that this pulls back a very strange list, it appears to have every type of contact (i.e phones, emails, twitter, etc) as well as a huge list of "Unnamed" contacts and my number listed about 100 times. What i want is for it just to pull back the same list as when I hit the "phones" widget on my phone. how do I get it to do that? has anybody else hit this issue? know what the hell its doing? have any advice?

what I am really hating about android is that all the examples out there appear to deprecated, and the suggested "new" ways of doing it are not intuitive (android development misses on the concept of "abstraction" in programming) and are lacking any real code examples.

Everyone loves to hate on Microsoft, but at least their documentation is well-written, has plenty of examples, and everything doesn't become deprecated after 5 minutes.

Thanks for your help!

1条回答
放我归山
2楼-- · 2019-05-25 01:44

Here is a working code: https://github.com/rbochet/MeshMS-interface-mockup/blob/master/src/fr/stackr/android/meshms/SMSInterface.java

I agree with you for the deprecated stuff… Can get pretty boring.

查看更多
登录 后发表回答