判断联系人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);

你可能感兴趣的:(android)