final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection)); // final MatrixCursor.RowBuilder row = result.newRow(); row.add(Root.COLUMN_ROOT_ID, ROOT); row.add projection, String sortOrder) throws FileNotFoundException { final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection)); final File parent final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
; import android.content.SharedPreferences; import android.database.Cursor; import android.database.MatrixCursor context, key, null); } private Cursor createSingleCursor(String key, String value) { MatrixCursor cursor = new MatrixCursor(new String[]{key}, 1); if (! return cursor; } private Cursor createCursor(String[] keys, String[] values) { MatrixCursor cursor = new MatrixCursor(keys, 1); cursor.addRow(values); return cursor; }
private static MatrixCursor sAddressCursor = new MatrixCursor(new String[] { "_id", "city" }); static private static MatrixCursor sAddressCursor = new MatrixCursor(new String[] { "_id", "city" }); static private static MatrixCursor sAddressCursor = new MatrixCursor(new String[] { "_id", "city" }); static private static MatrixCursor sAddressCursor = new MatrixCursor(new String[] { "_id", "city" }); static private static MatrixCursor sAddressCursor = new MatrixCursor(new String[] { "_id", "city" }); static
query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { MatrixCursor matrixCursor = new MatrixCursor(new String[]{"_display_name"}); matrixCursor.addRow(new Object[] /lib-main/lib.so"}); return matrixCursor; } public ParcelFileDescriptor openFile(Uri uri, String
.准备数据 一般情况下Cursor都是通过查找数据获取到的,此处我们的重点是看如何用在SimpleCursorAdapter中来绑定到ListView中,因此我们使用可以直接示例化并可以直接插入数据的MatrixCursor 代码如下: String[] tableCursor = new String[] { "_id", "name", "phone" }; MatrixCursor cursor = new MatrixCursor
返回值是一个 Cursor,它必须指向目标数据集,即使没有结果,也应该返回不为 null 的 Cursor(如 MatrixCursor)。
} } cols = copyOf(cols, i); values = copyOf(values, i); final MatrixCursor cursor = new MatrixCursor(cols, 1); cursor.addRow(values); return cursor; }
} } cols = copyOf(cols, i); values = copyOf(values, i); final MatrixCursor cursor = new MatrixCursor(cols, 1); cursor.addRow(values); return cursor; }
SearchIndexablesProvider { @Override public Cursor queryXmlResources(String[] projection) { final MatrixCursor cursor = new MatrixCursor(INDEXABLES_XML_RES_COLUMNS); final List<SearchIndexableResource> resources
public class DispatcherCursor extends MatrixCursor { public static final String KEY_BINDER_WRAPPER
如,MatrixCursor类实现了每行是一个对象数组的游标,这个类用addRow()方法来添加新行。 记住,Android系统必须能够跨进程来传递异常。