本文整理汇总了Java中android.database.MatrixCursor.moveToNext方法的典型用法代码示例。如果您正苦于以下问题:Java MatrixCursor.moveToNext方法的具体用法?Java MatrixCursor.moveToNext怎么用?Java MatrixCursor.moveToNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.database.MatrixCursor
的用法示例。
在下文中一共展示了MatrixCursor.moveToNext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: query
import android.database.MatrixCursor; //导入方法依赖的package包/类
public Cursor query(
@NonNull Uri paramUri,
String[] paramArrayOfString1,
String paramString1,
String[] paramArrayOfString2,
String paramString2) {
MatrixCursor cursor = new MatrixCursor(new String[] {"string"});
try {
if (getContext() == null) {
return cursor;
}
final String path = paramUri.getPath().substring(1);
final String[] items = getContext().getAssets().list(path);
for (String s : items) {
cursor.newRow().add(s);
cursor.moveToNext();
}
cursor.moveToFirst();
} catch (Exception e) {
cursor.close();
throw new RuntimeException(e);
}
return cursor;
}
示例2: testNullValue
import android.database.MatrixCursor; //导入方法依赖的package包/类
public void testNullValue() {
MatrixCursor cursor = new MatrixCursor(new String[] { "a" });
cursor.newRow().add(null);
cursor.moveToNext();
assertTrue(cursor.isNull(0));
assertNull(cursor.getString(0));
assertNull(cursor.getBlob(0));
assertEquals(0, cursor.getShort(0));
assertEquals(0, cursor.getInt(0));
assertEquals(0L, cursor.getLong(0));
assertEquals(0.0f, cursor.getFloat(0));
assertEquals(0.0d, cursor.getDouble(0));
}
示例3: testMatrixCursor
import android.database.MatrixCursor; //导入方法依赖的package包/类
public void testMatrixCursor() {
MatrixCursor cursor = newMatrixCursor();
cursor.newRow()
.add("a")
.add(1)
.add(2)
.add(3)
.add(4)
.add(5)
.add(new byte[] {(byte) 0xaa, (byte) 0x55});
cursor.moveToNext();
checkValues(cursor);
cursor.newRow()
.add("a")
.add("1")
.add("2")
.add("3")
.add("4")
.add("5")
.add(new byte[] {(byte) 0xaa, (byte) 0x55});
cursor.moveToNext();
checkValues(cursor);
cursor.moveToPrevious();
checkValues(cursor);
}
示例4: testAddArray
import android.database.MatrixCursor; //导入方法依赖的package包/类
public void testAddArray() {
MatrixCursor cursor = newMatrixCursor();
cursor.addRow(new Object[] { "a", 1, 2, 3, 4, 5, new byte[] {(byte) 0xaa, (byte) 0x55} });
cursor.moveToNext();
checkValues(cursor);
try {
cursor.addRow(new Object[0]);
fail();
} catch (IllegalArgumentException e) { /* expected */ }
}
示例5: query
import android.database.MatrixCursor; //导入方法依赖的package包/类
public Cursor query(Uri paramUri, String[] paramArrayOfString1, String paramString1, String[] paramArrayOfString2, String paramString2) {
MatrixCursor cursor = new MatrixCursor(new String[]{"string"});
try {
final String path = paramUri.getPath().substring(1);
for (String s : getContext().getAssets().list(path)) {
cursor.newRow().add(s);
cursor.moveToNext();
}
cursor.moveToFirst();
} catch (Exception e) {
e.printStackTrace();
}
return cursor;
}