Skip to content Skip to sidebar Skip to footer

Possible Bug With Samsung Roms?

I'm currently working in an app that shows a contact list to the user. In that list, the name, the contact picture and the email of the contact must be shown, so I get the list lik

Solution 1:

I would change your query like so...

= managedQuery(ContactsContract.Data.CONTENT_URI
, null
, ContactsContract.DATA.MIMETYPE+"=? AND "+ContactsContract.CommonDataKinds.Email.TYPE+"=?"
, newString[]{ContactsContract.CommonDataKinds.Email.Content_Item_Type, ContactsContract.CommonDataKinds.Email.TYPE_HOME}
, ContactsContract.DATA.DISPLAY_NAME );

I didn't test this but should be right or similar.

a naive method to display a Cursor to help with debugging

publicstaticvoiddisplayCursor(Cursor c){
    int columnCount;
    if(c.moveToFirst()){
        columnCount = c.getColumnCount();
        do{
            Log.i(" ", "********************");
            for(int i=0;i<columnCount;i++){
                try{ 
                    Log.i(c.getColumnName(i)+":", c.getString(i)+" ");
                }catch(Exception e){

                }
            }
        }while(c.moveToNext());
    }
}

Post a Comment for "Possible Bug With Samsung Roms?"