Questions tagged [android-paging-library]
189 questions
8
votes
2 answers
Restoring Scroll Position in Paging Library 3
I am using Paging Library 3 with a RemoteMediator which includes loading data from the network and the local Room database. Every time I scroll to a certain position in the RecyclerView, navigate away to another Fragment, and then navigate back to…

Calvin Rai
- 816
- 1
- 8
- 17
8
votes
3 answers
Sticky headers with paging library in Jetpack Compose
I'm currently playing around with the new Jetpack compose UI toolkit and I like it a lot. One thing I could not figure out is how to use stickyHeaders in a LazyColumn which is populated by the paging library. The non-paging example from the…

Cilenco
- 6,951
- 17
- 72
- 152
8
votes
7 answers
Paging library 3.0 : How to pass total count of items to the list header?
Help me please.
The app is just for receiving list of plants from https://trefle.io and showing it in RecyclerView.
I am using Paging library 3.0 here.
Task: I want to add a header where total amount of plants will be displayed.
The problem: I just…

Waldmann
- 1,563
- 12
- 25
8
votes
1 answer
androidx.paging.PagedListAdapter' is deprecated
I'm using an alpha release of androidx's paging library in my android project. It used to work fine but today my android studio started to show this deprecation warning about the PagedListAdapter class. I searched on google and also checked out the…

Nilesh Rathore
- 886
- 1
- 12
- 22
8
votes
1 answer
Android Paging 3 doesnt show Loadstate Adapter
I have followed a tutorial to add Loadstate Adapter to the Recyclerview Adapter on Android Paging 3 but currently, it's not showing. This is how I am updating the Adapter.
lifecycleScope.launch {
viewModel.searchProducts(searchParam,…

ronnieotieno
- 134
- 2
- 11
8
votes
4 answers
Jetpack Paging3 library makes several calls to the same page
I am trying to implement Jetpack paging 3 library following the codelab using room database as source of truth and a RemoteMediator. The app queries the google books api but for some reason when I perform a search it makes several calls to the same…

Timi1ehin
- 95
- 1
- 8
8
votes
3 answers
Changing request and get a new data stream when using Paging3 library
I have used Jetpack's Paging 3 library in my project for handling data pagination. I have a use case which when user changes something in search request (for example adding/removing some filters), I have to call API and repopulate my list with new…

Amin Mousavi
- 1,220
- 10
- 21
8
votes
2 answers
LiveData Paged List size is always 0
I implemented Paging using android paging library. The ViewModel returns a LiveData> and I observe that in the fragment where I set the adapter and everything is working good, except that when I want to check the size of the list…

max
- 443
- 7
- 13
7
votes
2 answers
Api call is not stopped calling again and again without any scrolling in Google Paging Library 3
I want to implement pagination to show a chunk of list of my desire item view in my app. That's why I choose to use Google newly released paging library i.e Paging library 3. I use Rxjava, Livedata, and ViewModel in my app.
After implementing the…

Aminul Haque Aome
- 2,261
- 21
- 34
7
votes
4 answers
How to restore recyclerview scroll position when using PagingDataAdapter?
I have an App that fetches a list of 158 Items from an API, stores it in Room, and displays it to the user. RoomDB is the source of truth.
This is the code on my ViewModel that gets the result from the database:
private val pagingConfig =
…

Doilio Matsinhe
- 2,131
- 16
- 29
6
votes
2 answers
Android Paging 3 library PagingSource invalidation, causes the list to jump due to wrong refresh key (not using room)
Since I'm currently working on a Project with custom database (not Room), I'm testing whether we could use the Paging 3 library in the Project.
However, I run into the issue, that if you make changes to the data and therefore invalidate the paging…

MEX
- 2,664
- 5
- 22
- 28
6
votes
0 answers
"Channel was closed" message when using Paging 3 from androidx
I have tried to convert my Paging 2 implementation to Paging 3 with Flow in my app, but are plagued by a "Channel was closed" Exception. The app works fine, but crashes after some time (from a few seconds up to many minutes). It loads data from web,…

Roar Grønmo
- 2,926
- 2
- 24
- 37
6
votes
2 answers
RecyclerView remains empty with Paging Library and PositionalDataSource
I am trying to configure the Android Paging library in my project to load a paginated list of messages into a RecyclerView. Since my API uses offset and max, I'm using a PositionalDataSource.
Here is my DataSource implementation, where DataStore is…

Sebastien
- 3,583
- 4
- 43
- 82
6
votes
0 answers
Android PageKeyedDataSource (paging library) callback error handling (there is TODO exception in src)
I want to pass an error exception to my paging adapter via callback.onError(or callback.onRetryableError) in loadInitial or loadafter but always receive crashes.
After some debugging I find this in library sources:
It's actually what I'm receiving…

once2go
- 1,452
- 1
- 13
- 21
5
votes
2 answers
Updating Paging 3 alpha to stable cause indexing issue Android
Hey I am using Paging 3 library with ViewPager 2. In which it loads unlimited data.
implementation "androidx.paging:paging-runtime-ktx:3.0.0-alpha07"
DataSource.kt
package com.example.viewpagerexample
import java.util.*
class DataSource(
…

Kotlin Learner
- 3,995
- 6
- 47
- 127