本文整理匯總了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;
}