"This RelativeLayout layout or its RelativeLayout parent is possibly useless" - measure performance

370 views Asked by At

Android Lint gives me these warnings

"This RelativeLayout layout or its RelativeLayout parent is possibly useless; transfer the background attribute to the other view" or similar.

I'm wondering simply: how can I measure the impact on performance of fixing this? What do I need to monitor?

1

There are 1 answers

1
Dom On BEST ANSWER

I believe the lint is warning you about overdraw:

An app may draw the same pixel more than once within a single frame, an event called overdraw. Overdraw is usually unnecessary, and best eliminated. It manifests itself as a performance problem by wasting GPU time to render pixels that don't contribute to what the user sees on the screen.

Theres a developer setting that you can turn on that visualises overdraw on your device. Check out this video by Colt McAnlis on the subject: https://www.youtube.com/watch?v=T52v50r-JfE

Also check out this for a deeper insight: https://developer.android.com/topic/performance/rendering/overdraw.html