skip to Main Content

I have a FragmentA(with Recyclerview) and a FragmentB(item). When I click in A to jump to B, the page lags a bit, maybe I updated the content in the main thread? But I don’t seem to be doing that.

In FragmentB, I have some text and 3 Recyclerview, maybe the recyclerview cause the lag?
enter image description here

May be I need to load the data after the transition animation is complete? How to finish it?

2

Answers


  1. It can be because of many things. Check if you are using a large image size that can use more power and time to render. Try to move your long operations into coroutines.

    Login or Signup to reply.
  2. As your layouts has one image, 3 recycler view & other stuff there is many cases for layout lagging.

    1. May the image you are loading is larger. (Try: load it with Glide or other image loading libraries)

    2.May your 3 recycler listing has large number of items & you are loading them immediately after creating your fragment view. (Try: put them into the runnanble & load them after some delay of a time)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search