`
wang_peng1
  • 浏览: 3900763 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

判断联系人Contacts的版本问题

阅读更多

Intent intent = null;
                        ClassLoader classLoader = DialerContactList.class.getClassLoader();
                        try
                        {
                                classLoader.loadClass("android.provider.ContactsContract");
                                intent = new Intent(Intent.ACTION_PICK,Uri.parse("content://
com.android.contacts/data/phones"));
                        }
                        catch (ClassNotFoundException e)
                        {
                        }
                        if (intent == null)
                        {
                                intent = new Intent(Intent.ACTION_PICK,Phones.CONTENT_URI);
                        }
                        startActivityForResult(intent, ADD_CONTACT);

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics