本文整理了Java中android.database.Cursor.moveToPrevious()
方法的一些代码示例,展示了Cursor.moveToPrevious()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cursor.moveToPrevious()
方法的具体详情如下:
包路径:android.database.Cursor
类名称:Cursor
方法名:moveToPrevious
暂无
代码示例来源:origin: robolectric/robolectric
@Override @Implementation
public boolean moveToPrevious() {
return wrappedCursor.moveToPrevious();
}
代码示例来源:origin: k9mail/k-9
mActiveCursor.moveToPrevious();
代码示例来源:origin: k9mail/k-9
public EmailProviderCacheCursor(String accountUuid, Cursor cursor, Context context) {
super(cursor);
mCache = EmailProviderCache.getCache(accountUuid, context);
mMessageIdColumn = cursor.getColumnIndex(MessageColumns.ID);
mFolderIdColumn = cursor.getColumnIndex(MessageColumns.FOLDER_ID);
mThreadRootColumn = cursor.getColumnIndex(ThreadColumns.ROOT);
if (mMessageIdColumn == -1 || mFolderIdColumn == -1 || mThreadRootColumn == -1) {
throw new IllegalArgumentException("The supplied cursor needs to contain the " +
"following columns: " + MessageColumns.ID + ", " + MessageColumns.FOLDER_ID +
", " + ThreadColumns.ROOT);
}
while (cursor.moveToNext()) {
long messageId = cursor.getLong(mMessageIdColumn);
long folderId = cursor.getLong(mFolderIdColumn);
if (mCache.isMessageHidden(messageId, folderId)) {
mHiddenRows.add(cursor.getPosition());
}
}
// Reset the cursor position
cursor.moveToFirst();
cursor.moveToPrevious();
}
代码示例来源:origin: k9mail/k-9
if (result > 0) {
smallest = i;
left.moveToPrevious();
} else {
right.moveToPrevious();
代码示例来源:origin: lingochamp/FileDownloader
public List<TasksManagerModel> getAllTasks() {
final Cursor c = db.rawQuery("SELECT * FROM " + TABLE_NAME, null);
final List<TasksManagerModel> list = new ArrayList<>();
try {
if (!c.moveToLast()) {
return list;
}
do {
TasksManagerModel model = new TasksManagerModel();
model.setId(c.getInt(c.getColumnIndex(TasksManagerModel.ID)));
model.setName(c.getString(c.getColumnIndex(TasksManagerModel.NAME)));
model.setUrl(c.getString(c.getColumnIndex(TasksManagerModel.URL)));
model.setPath(c.getString(c.getColumnIndex(TasksManagerModel.PATH)));
list.add(model);
} while (c.moveToPrevious());
} finally {
if (c != null) {
c.close();
}
}
return list;
}
代码示例来源:origin: Hitomis/transferee
latestImagePaths.add(path);
if (latestImagePaths.size() >= maxCount || !cursor.moveToPrevious()) {
break;
代码示例来源:origin: robolectric/robolectric
@Test
public void testMoveToPreviousPastStart() throws Exception {
assertThat(cursor.moveToFirst()).isTrue();
// Impossible to move cursor before the first item
assertThat(cursor.moveToPrevious()).isFalse();
}
代码示例来源:origin: robolectric/robolectric
@Test
public void testMoveToPrevious() throws Exception {
assertThat(cursor.moveToFirst()).isTrue();
assertThat(cursor.moveToNext()).isTrue();
assertThat(cursor.moveToPrevious()).isTrue();
assertThat(cursor.getInt(0)).isEqualTo(1234);
assertThat(cursor.getString(1)).isEqualTo("Chuck");
}
代码示例来源:origin: robolectric/robolectric
@Test
public void testMoveToPreviousEmpty() throws Exception {
setupEmptyResult();
assertThat(cursor.moveToFirst()).isFalse();
assertThat(cursor.moveToPrevious()).isFalse();
}
代码示例来源:origin: parse-community/Parse-SDK-Android
@Override
public boolean moveToPrevious() {
return cursor.moveToPrevious();
}
代码示例来源:origin: com.j256.ormlite/ormlite-android
@Override
public boolean previous() {
return cursor.moveToPrevious();
}
代码示例来源:origin: org.openmobster.core.mobileCloud.android.2_0/api
@Override
public boolean moveToPrevious()
{
return cursor.moveToPrevious();
}
代码示例来源:origin: com.novoda/notils
@Override
public boolean moveToPrevious() {
return cursor.moveToPrevious();
}
代码示例来源:origin: arconsis/droitatedDB
private void moveBeforeFirst() {
originalCursor.moveToFirst();
originalCursor.moveToPrevious();
}
代码示例来源:origin: hacktoberfest17/programming
public void onClick(View v) {
// TODO Auto-generated method stub
try {
//mueve el cursor una posicion atras
c.moveToPrevious();
et_nombre.setText(c.getString(1));
et_correo.setText(c.getString(2));
et_numero.setText(c.getString(3));
} catch (Exception e) {
}
}
代码示例来源:origin: stackoverflow.com
Cursor cursor = getContentResolver().query(
ContactsContract.Contacts.CONTENT_URI, null,
null, null, null);
if (!cursor.moveToFirst())
return;
cursor.moveToLast();
do{
String id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
String name = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
}while (cursor.moveToPrevious()) ;
代码示例来源:origin: org.robolectric/shadows-core
@Implementation
public boolean moveToPrevious() {
return wrappedCursor.moveToPrevious();
}
代码示例来源:origin: org.robolectric/shadows-core-v23
@Implementation
public boolean moveToPrevious() {
return wrappedCursor.moveToPrevious();
}
代码示例来源:origin: stackoverflow.com
Cursor c=dbAdapter.fetchdata();
int MSG=.getColumnIndex("Message");
for(c.moveToLast();!c.isBeforeFirst();c.moveToPrevious())
{
}
代码示例来源:origin: arconsis/droitatedDB
@Override
public T getPrevious() {
assertEmptyCursor();
if (!hasPrevious()) {
throw new NoSuchElementException("There is no previos element in cursor!");
}
originalCursor.moveToPrevious();
return construct();
}
内容来源于网络,如有侵权,请联系作者删除!