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.
Asked
Active
Viewed 61 times
1 Answers
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
-
Not just in ListViews. It is a custom subclass of FrameLayout that syncs its properties to a Model object. – William Jockusch May 21 '15 at 18:23
-
If you use a framelayout, maybe Cards (same link as above) could work for you. They are inserted as rows into the RecyclerView. – Emanuel0101 May 22 '15 at 18:44