I spent sometime yesterday struggling with android layouts (... or better custom layouts). For general purposes forms the out of the box layouts that androids offers are mor
The available documentation on custom layouts seems rather vague to me, but I finally found something useful: Here is a nice simple sample layout that shows how to connect XML and Java code: How to layout a 'grid' of images in the center of the screen And here is a post which explains one key issue I was missing: http://www.arpitonline.com/blog/2012/07/01/creating-custom-layouts-for-android/. Apparently one has to override onMeasure and call measure() for each child.