MVVM Architecture Screen Rotation Issues

27 Views Asked by At

I have been trying to make a simple program where I will get data from Retrofit API calling into RecyclerView using MVVM architecture with JAVA, but I am not getting any data from Retrofit API into recycler view until or unless I rotate the screen of the phone. I am using asynchronous API calling using Retrofit and my research shows that so many people have this problem of not getting data until or unless screen rotation happens but there was not even a single solution for this. I am also using MutableLiveData<> and LiveData<> to keep track of any change or new data from API.

I am also using MutableLiveData<> and LiveData<> to keep track of any change or new data from API. I have applied onChangeListener() on the adapter of the RecyclerView

0

There are 0 best solutions below