Code example for MatrixCursor

Methods: newRow

0
                    null, 
                    SORT_ORDER);
 
        if (phone.length() > 0) {
 
            MatrixCursor translated = new MatrixCursor(PROJECTION_PHONE, 1 /*2*/);
             
            RowBuilder result = translated.newRow();
            result.add(Integer.valueOf(-1));                    // ID
            result.add(Long.valueOf(-1));                       // CONTACT_ID
            result.add(Integer.valueOf(ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM));     // TYPE
            result.add(cons);                                  // NUMBER
 
            result.add("\u00A0");                               // LABEL
            result.add(cons);                                   // NAME
             
            //Rewriten as phone number 
            /* 
            result = translated.newRow(); 
            result.add(Integer.valueOf(-1));                    // ID 
            result.add(Long.valueOf(-1));                       // CONTACT_ID