Code example for MatrixCursor

Methods: addRow

0
            if (uri.toString().equals("content://" + mAuthority + "/directories")) {
                // Should tolerate multiple queries. 
                mResponse.moveToPosition(-1);
                return mResponse;
            } else if (uri.toString().startsWith("content://" + mAuthority + "/contacts")) {
                MatrixCursor cursor = new MatrixCursor(
                        new String[] { "projection", "selection", "selectionArgs", "sortOrder",
                                "accountName", "accountType"}); 
                cursor.addRow(new Object[] {
                    Lists.newArrayList(projection).toString(),
                    selection,
                    Lists.newArrayList(selectionArgs).toString(),
                    sortOrder,
                    uri.getQueryParameter(RawContacts.ACCOUNT_NAME),
                    uri.getQueryParameter(RawContacts.ACCOUNT_TYPE),
                }); 
                return cursor;
            } else if (uri.toString().startsWith(
                    "content://" + mAuthority + "/aggregation_exceptions")) {
                return new MatrixCursor(projection);
            }