Hey, I need help in paging 3 lib , I want to updat...
# android
a
Hey, I need help in paging 3 lib , I want to update the pagingdata and then want to reflect in adapter which is not happening rightnow
google 1
stackoverflow 3
s
What exactly is your case?
a
Hi Samir, the problem is, I am fetching the data using paging 3 lib and then I am changing the query params and making api call again and fetching the data and l got the data successfully but it is not rendering in ui. I mean adapter is not getting notified.
It is showing the previous data on ui
s
call refresh() method on your adapter instance to reload data instead of calling api again
a
But I am changing the params of api call
I need to change
Params
Query params
s
I think you can create companion object in your activity/fragment where you define your query params and thus from PagingSource u can access those. So just change your query param variable in activity's companion section and then call refresh
a
Ok let me try with this.
Adapter.refresh will render the newly updated data on adapter??????
s
Yup
a
Ok , I am trying with this
Not working
Still
s
You will need to post your code in stackoverflow i guess.
a
Okay thanks
s
If you do let me know i wanna look at your code
a
Okay how can I send it to you
s
U can message me the stackoverflow link here in slack
a
Okay I will