0

I am introducing view object recycling into my Android app to help performance. It does help with that. But when a new screen appears, I am seeing brief artifacts which I assume are related to the prior state of the views. The artifacts take the form of a rectangular region of some color that should not be there. The app adjusts itself to the correct state very quickly, but it's still annoying. I am wondering if there is a way to prevent this. What I am currently doing is removing the old view from the hierarchy and un-setting its event handlers. Obviously, that is not enough. LayoutParams typically relate a view to its parent; perhaps I need to be somehow "un-laying-out" the view when removing it? But I'm not sure how to do that.

William Jockusch
  • 26,513
  • 49
  • 182
  • 323

1 Answers1

0

If your performance issues lay in a ListView, you can use RecyclerView instead to help that: https://developer.android.com/training/material/lists-cards.html.

Besides that, how exactly are you recycling and what type of Views do you use?

Emanuel0101
  • 113
  • 1
  • 10