Retriving requried data form Content Providers using single cursor.

Posted by HellBoy on Stack Overflow See other posts from Stack Overflow or by HellBoy
Published on 2010-12-31T07:38:33Z Indexed on 2011/01/01 8:54 UTC
Read the original article Hit count: 235

Filed under:

I want to retrieve Name,Number,Company,and Designation so I am retrieving it using 2 cursor as follow

Cursor cursor1 = getContentResolver().query(Data.CONTENT_URI, 
            new String[]{Organization.COMPANY, Organization.TITLE}, Data.MIMETYPE + 
"='" + Organization.CONTENT_ITEM_TYPE + "'", null, null);

 Cursor cursor2 = getContentResolver().query(Phone.CONTENT_URI, 
            new String[]{Phone.NUMBER, Phone.DISPLAY_NAME}, null, null, null);

but How retrieve using one cursor or passing query one time only.

© Stack Overflow or respective owner

Related posts about android