In my app I have a time display which updates every second. Each time the TextView used for the seconds field changes, the Developer Options->Show surface updates tool flashes the entire screen. I’ve looked around and can really only find this question which pretty well clarifies that there is no way to prevent the TextView from causing a relayout for at least part of the window. So I was sure to verify that my TextView’s are wrapped in their own container but I still have the same issue. Every call to setText() causes the entire view to flash.
My hierarchy is as follows:
- Fragment
- RelativeLayout (Fragment Root View)
- LinearLayout
- RelativeLayout
- My Time TextViews
- RelativeLayout
- Various other view components which change rarely
- LinearLayout
- RelativeLayout (Fragment Root View)
I would like to fix this if possible. I do need to try and reduce my view count if possible and I plan on working on it but this is still a problem I would like to remove from the app.
Show surface updates flashes the entire screen when hardware acceleration is on but it does not mean the entire window was redrawn. There is another option you can use that shows you exactly what part of the screen was redrawn when hardware acceleration is on (“Show GPU view updates”).