Code example for MatrixCursor

Methods: addRow

     * Creates a dummy cursor to represent the "Searching directory..." item. 
    private Cursor createLoadingCursor() {
        MatrixCursor cursor = new MatrixCursor(new String[]{SEARCHING_CURSOR_MARKER});
        cursor.addRow(new Object[]{""});
        return cursor;
    public void onPartitionLoadFinished( 
            CharSequence constraint, int partitionIndex, Cursor cursor) {
        if (partitionIndex < getPartitionCount()) {
            DirectoryPartition partition = (DirectoryPartition) getPartition(partitionIndex);
            // Check if the received result matches the current constraint 
            // If not - the user must have continued typing after the request 
            // was issued 
            if (partition.loading && TextUtils.equals(constraint, partition.constraint)) {
                partition.loading = false;
                mHandler.removeMessages(MESSAGE_SEARCH_PENDING, partition);