如何用Android分頁修復(fù)?我閱讀了Fi還原文檔和互聯(lián)網(wǎng)上關(guān)于Fi還原分頁的所有文章(堆棧溢出),但是沒有運氣。我試圖在文檔中實現(xiàn)確切的代碼,但什么也沒有發(fā)生。我有一個包含項目(超過1250項或更多)的基本數(shù)據(jù)庫,我希望逐步獲得它們。通過滾動加載15個項(到數(shù)據(jù)庫中的最后一個項)。如果使用docs代碼:// Construct query for first 25 cities, ordered by populationQuery first = db.collection("cities")
.orderBy("population")
.limit(25);first.get()
.addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
@Override
public void onSuccess(QuerySnapshot documentSnapshots) {
// ...
// Get the last visible document
DocumentSnapshot lastVisible = documentSnapshots.getDocuments()
.get(documentSnapshots.size() -1);
// Construct a new query starting at this document,
// get the next 25 cities.
Query next = db.collection("cities")
.orderBy("population")
.startAfter(lastVisible)
.limit(25);
// Use the query for pagination
// ...
}});怎么辦?文檔沒有太多的細節(jié)。PS:當用戶滾動時,我需要使用回收器視圖(而不是列表視圖)。謝謝
添加回答
舉報
0/150
提交
取消