How do get the android sdk contact picker to give me just phone results and not all my twitter followers

风格不统一 提交于 2019-12-10 10:57:47

问题


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:


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.



来源:https://stackoverflow.com/questions/8332846/how-do-get-the-android-sdk-contact-picker-to-give-me-just-phone-results-and-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!