标签:android style class blog code java
和短信一样在data-data下
package com.example.android_readphone.provider; import android.content.ContentResolver; import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract; import android.test.AndroidTestCase; /** * 测试获取联系人 * * @author zhaoyazhi * */ public class PhoneProviderTest extends AndroidTestCase { public void readContacts() { ContentResolver contentResolver = getContext().getContentResolver(); Cursor c = contentResolver.query( ContactsContract.RawContacts.CONTENT_URI, new String[] { "_id", "display_name" }, null, null, null); while (c.moveToNext()) { String id = c.getString(c .getColumnIndex(ContactsContract.RawContacts._ID)); String name = c.getString(c.getColumnIndex("display_name")); System.out.println("序号id:" + id + "----------name:" + name ); } c.close(); } }
赵雅智_android系统联系人app分析并获取数据,布布扣,bubuko.com
标签:android style class blog code java
原文地址:http://blog.csdn.net/zhaoyazhi2129/article/details/30367661