Code example for MatrixCursor

Methods: newRow

0
     * check the projection to properly match the columns. 
     */ 
    private void addRow(MatrixCursor matrix, int match_id) {
        switch (match_id) {
            case PHOTO_INDIVIDUAL_1:
                matrix.newRow()
                .add("content://" + PROVIDER_URI + "/photos/1")                 // uri
                .add("blah.png")                                                // displayName
                .add("content://" + PROVIDER_URI + "/photos/1/contentUri")      // contentUri
                .add("content://" + PROVIDER_URI + "/photos/1/thumbnailUri")    // thumbnailUri
                .add("image/png");                                              // contentType
                break; 
            case PHOTO_INDIVIDUAL_2:
                matrix.newRow()
                .add("content://" + PROVIDER_URI + "/photos/2")                 // uri
                .add("johannson.png")                                           // displayName
                .add("content://" + PROVIDER_URI + "/photos/2/contentUri")      // contentUri
                .add("content://" + PROVIDER_URI + "/photos/2/thumbnailUri")    // thumbnailUri
                .add("image/png");                                              // contentType
                break; 
            case PHOTO_INDIVIDUAL_3:
                matrix.newRow()
                .add("content://" + PROVIDER_URI + "/photos/3")                 // uri
                .add("planets.png")                                             // displayName
                .add("content://" + PROVIDER_URI + "/photos/3/contentUri")      // contentUri
                .add("content://" + PROVIDER_URI + "/photos/3/thumbnailUri")    // thumbnailUri
                .add("image/png");                                              // contentType
                break; 
            case PHOTO_INDIVIDUAL_4:
                matrix.newRow()
                .add("content://" + PROVIDER_URI + "/photos/4")                 // uri
                .add("galaxy.png")                                              // displayName
                .add("content://" + PROVIDER_URI + "/photos/4/contentUri")      // contentUri
                .add("content://" + PROVIDER_URI + "/photos/4/thumbnailUri")    // thumbnailUri
                .add("image/png");                                              // contentType