【发布时间】:2011-05-14 10:03:12
【问题描述】:
我正在尝试检索 电话 号码,因此使用
String addrWhere = Contacts.Phones.NUMBER + " = " + userNumber;
String id = "";
Cursor c = mContext.getContentResolver().query(
Contacts.Phones.CONTENT_URI,
new String[] { Contacts.Phones._ID }, addrWhere, null, null);
try {
if (c.getCount() > 0) {
c.moveToFirst();
id = c.getString(0);
Log.i("IDS", id);
}
} finally {
c.close();
}
return id;
谁能告诉我我在这方面的错误?
【问题讨论】:
标签: android android-contacts phone-number