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);
判断联系人Contacts的版本问题
最新推荐文章于 2021-05-29 00:59:24 发布
本文介绍了一种在Android应用中启动联系人选择器的方法。通过加载`android.provider.ContactsContract`类并创建一个用于选择联系人的Intent。如果加载类失败,则提供了一个备选方案来实现相同的功能。
1万+

被折叠的 条评论
为什么被折叠?



