ContentResolver query Grammar

by Ivy » Fri, 17 Jul 2009 11:36:12 GMT


Sponsored Links
 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?
--~--~---------~--~----~------------~-------~--~----~



ContentResolver query Grammar

by Ivy » Fri, 17 Jul 2009 11:59:50 GMT


 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);




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Motorola App Accelerator program - is it a dead end?

So,
I Think join Motorola Acelerator Program makes you be involved with Motorola
Engeniers and help you learn to be on top, when motorola android phones
explode on market...


On Thu, Nov 5, 2009 at 12:31 PM, nEx.Software









> 

2. ActiveSync provisioning on Android 2.0

I downloaded the SDK to test the ActiveSync support, specifically if
the device supports provisioning of Activesync password policies. It
seems that it does not.

Many Exchange shops require policies like password protection and
remote wipe. With these policies enforced (allow non-provisionable
devices is unchecked in AS policy in Exchange), the phone will not
sync.

Does anyone know if this was an oversight in the implementation, or if
it was designed this way?

It looks like Palm's WebOS had a similar issue that was fixed in
version 1.2.0, although I haven't tested this phone to confirm.

http://kb.palm.com/wps/portal/kb/na/pre/p100eww/sprint/solutions/article/50607_en.html#N06744130.0670D02C

--~--~---------~--~----~------------~-------~--~----~

3. Got Motorola Droid today but have a problem with Facebook contacts.

4. HTC Magic Wifi not working

5. get xy of bitmap during onTouch in custom ImageView component

6. Android Developers Wanted

7. ADC2 categories