/*--- Load News Feed in Recycler View ---*/
private void loadNewsFeed(){
CollectionReference collectionReference = firebaseFirestore.collection("News Feed");
query = collectionReference
.orderBy("newsFeedId", Query.Direction.DESCENDING);
PagingConfig config = new PagingConfig(1,
1,
false);
FirestorePagingOptions<ModelNewsFeed> options = new FirestorePagingOptions.Builder<ModelNewsFeed>()
.setLifecycleOwner(this)
.setQuery(query, config, ModelNewsFeed.class)
.build();
adapterNewsFeedListFireStorePaginationAds = new AdapterNewsFeedListFireStorePaginationAds(options, this);
newsFeedRv.setAdapter(adapterNewsFeedListFireStorePaginationAds);
}
I am getting an Error at ".setQuery(query, config, ModelNewsFeed.class)"
Error: .setQuery(query, config, ModelNewsFeed.class)
^
method Builder.setQuery(Query,Config,Class<ModelNewsFeed>) is not applicable
(argument mismatch; PagingConfig cannot be converted to Config)
method Builder.setQuery(Query,Config,SnapshotParser<ModelNewsFeed>) is not applicable
(argument mismatch; PagingConfig cannot be converted to Config)
What's the solution to rectify this error?
I am trying to migrate from
Paging 2: androidx.paging:paging-runtime:2.1.2
to
Paging 3:
androidx.paging:paging-runtime:3.0.1.