The PhontUliti.formatPhoneNumber(String number) replace "" within
"-".And if i change like this the cursor is also null
String[] contactsProjection=new String[]
{People.NAME,People._ID,People.NUMBER,Contacts.Phones.TYPE};
Cursor contactsCursor=context.getContentResolver().query
(People.CONTENT_URI,
contactsProjection, PhontUliti.formatPhoneNumber(
People.NUMBER )
+" =?",
new String[]{"15827381718"},
People.DEFAULT_SORT_ORDER);
On 7月17日, 上午11时35分, Ivy <[email protected]> wrote:
> String phonenumberString=PhontUliti.formatPhoneNumber(number);
> String[] contactsProjection=new String[]
> {People.NAME,People._ID,People.NUMBER,Contacts.Phones.TYPE};
> Cursor contactsCursor=context.getContentResolver().query
> (People.CONTENT_URI,
> contactsProjection, People.NUMBER +" = "
> +phonenumberString,
> null, People.DEFAULT_SORT_ORDER);
>
> Why the contactsCursor is null?
> The number is in the contacts.
> Is there any mistakks in the query?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---