title: Improving Android layout inflating speed
body: <p>I have an Android game that includes a screen that lists all ongoing games, short description, opponents name and profile picture etc. Pretty similar to what Zynga's With Friends games have. However, I've always had huge performance issues with rendering the list of games when you have tens of ongoing games which all have to be listed.</p>
  
  <p>Since the loading times can be 5+ seconds, I figured it's time to do some profiling and figure out the bottlenecks. It turns out that roughly 70% of the time goes to inflating and initializing the layout elements (which have been minimized to be as flat and light as possible), so even if I could optimize the rest of the code to happen instantly, the loading time would still be unacceptable from UX perspective.</p>
  
  <p>A simple ListView wouldn't work due to the additional UI elements, such as buttons etc that do not follow the same template as the games. On iOS a similar structure is rendered almost instantly, even on 3GS, so I'd expect at least similar speeds from a similarly powered Android devices. What are my options to reduce the time used for layout inflation and initialization? </p>
  
  <p>(A Words With Friends screenshot for reference if you don't know what it looks like)<img src="https://i.stack.imgur.com/bp8m2.png" alt="enter image description here"></p>