本文整理了Java中com.google.firebase.database.Query.limitToFirst
方法的一些代码示例,展示了Query.limitToFirst
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.limitToFirst
方法的具体详情如下:
包路径:com.google.firebase.database.Query
类名称:Query
方法名:limitToFirst
[英]Create a query with limit and anchor it to the start of the window.
[中]使用limit创建一个查询,并将其锚定到窗口的开头。
代码示例来源:origin: chat-sdk/chat-sdk-android
.orderByChild(Keys.Meta + '/' + index)
.startAt(value)
.limitToFirst(limit);
query.keepSynced(true);
代码示例来源:origin: TomGrill/gdx-firebase
@Override
public Query limitToFirst(int limit) {
return new DesktopQuery(query.limitToFirst(limit));
}
代码示例来源:origin: UdacityAndroidDevScholarship/quiz-app
@Override
public void fetchResources(int startFrom, int limit, Callback<List<Resource>> callback) {
ValueEventListener listener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
if (snapshot != null) {
List<Resource> resources = new ArrayList<>();
for (DataSnapshot childSnapshot : snapshot.getChildren()) {
Resource resource = childSnapshot.getValue(Resource.class);
resources.add(resource);
}
callback.onReponse(resources);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
callback.onError();
}
};
Query resourcesQuery = mResourcesRef.orderByChild(KEY_TIMESTAMP);
if (limit > 0) {
resourcesQuery.limitToFirst(limit);
}
resourcesQuery.addValueEventListener(listener);
mValueListeners.add(listener);
}
代码示例来源:origin: UdacityAndroidDevScholarship/quiz-app
quizzesRefQuery.limitToFirst(limitToFirst);
代码示例来源:origin: dragosholban/AndroidMyInstagramApp
Query imagesQuery = database.child("images").orderByKey().limitToFirst(100);
imagesQuery.addChildEventListener(new ChildEventListener() {
@Override
内容来源于网络,如有侵权,请联系作者删除!